Skip to content

Customizable cubic bezier curve creator for Defold game engine.

Notifications You must be signed in to change notification settings

Sayuris1/bezier-curve

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Bezier Curve

A cubic bezier curve creator for the Defold game engine.

Feel free to ask questions: the topic about this asset is on the Defold forum.

Usage

  1. Add .zip as a Defold library dependency
  2. Add "adjustable_bezier.collection" from the bezier folder to your collection.

Settings

You can find some properties in the script component of the bezier game object

Is Nodes bool

If this is true, curve will have some draggable nodes to adjust it's shape.

Tan K float

Tangent multiplier.

Size float

Size of the curve.

Messages

You can adjust the curve by sending some messages to the script component.

update_point

Updates a point that was used to calculate the curve. Then re-calculates the curve and draws it.

PARAMETERS

  • index number - Which point to update
  • new_pos vec3 - New position of the point. MUST BE IN WORLD SPACE.
    msg.post("/adjustable_bezier/bezier#script", hash("update_point"), {index = 1, new_pos = vmath.vector3(100, 0, 0)})

Curve Points

set_node

Enable or disable the adjust nodes.

PARAMETERS

  • enabled bool - If true nodes are enabled. if not disabled.

set_tan_k

Updates tan_k.

PARAMETERS

  • tan_k float - New tan_k.

set_size

Updates size of the curve.

PARAMETERS

  • size float - New size.

set_color

Updates color of the curve.

PARAMETERS

  • color vec4 - New color.

About

Customizable cubic bezier curve creator for Defold game engine.

Resources

Stars

Watchers

Forks

Languages