All Projects → duongvituan → godot-action-animation-framework

duongvituan / godot-action-animation-framework

Licence: MIT license
create animation easy in Godot with GDAction

Programming Languages

GDScript
375 projects

Projects that are alternatives of or similar to godot-action-animation-framework

luban
你的最佳游戏配置解决方案 {excel, csv, xls, xlsx, json, bson, xml, yaml, lua, unity scriptableobject} => {json, bson, xml, lua, yaml, protobuf(pb), msgpack, flatbuffers, erlang, custom template} data + {c++, java, c#, go(golang), lua, javascript(js), typescript(ts), erlang, rust, gdscript, protobuf schema, flatbuffers schema, custom template} code。
Stars: ✭ 1,660 (+3760.47%)
Mutual labels:  godot, cocos2d-x
godot-awesome-splash
Collection of splash screens in Godot
Stars: ✭ 137 (+218.6%)
Mutual labels:  godot, gdaction
broken seals
An open source third person action RPG with multiplayer support.
Stars: ✭ 223 (+418.6%)
Mutual labels:  godot, action
liblast
A libre multiplayer FPS game created in Godot Engine
Stars: ✭ 92 (+113.95%)
Mutual labels:  godot
mypy-check
github action for python's mypy type checker tool
Stars: ✭ 23 (-46.51%)
Mutual labels:  action
setup-mingw
GitHub action to set up MinGW-w64
Stars: ✭ 51 (+18.6%)
Mutual labels:  action
godot-xterm
Terminal emulator for the Godot game engine.
Stars: ✭ 61 (+41.86%)
Mutual labels:  godot
k3d-action
A GitHub Action to run lightweight ephemeral Kubernetes clusters during workflow. Fundamental advantage of this action is a full customization of embedded k3s clusters. In addition, it provides a private image registry and multi-cluster support.
Stars: ✭ 137 (+218.6%)
Mutual labels:  action
Conquest
Risk-like game in Godot
Stars: ✭ 61 (+41.86%)
Mutual labels:  godot
gd-blender-3d-shortcuts
Blender 3D Shortcuts in Godot
Stars: ✭ 68 (+58.14%)
Mutual labels:  godot
godot-rpgdb
An easy to use JSON database-manager for Godot.
Stars: ✭ 25 (-41.86%)
Mutual labels:  godot
release-changelog-builder-action
A GitHub action that builds your release notes / changelog fast, easy and exactly the way you want.
Stars: ✭ 515 (+1097.67%)
Mutual labels:  action
auto-label
Auto Label Issue Based on Issue Description
Stars: ✭ 34 (-20.93%)
Mutual labels:  action
godot tools
A set of GDScript EditorScript and EditorPlugins tools that automate boring tasks on Godot Engine.
Stars: ✭ 50 (+16.28%)
Mutual labels:  godot
Voxly
Intuitive open source voxel editor; for both small and big ideas!
Stars: ✭ 46 (+6.98%)
Mutual labels:  godot
MKTween
Lightweight tween framework in Swift 5.0
Stars: ✭ 14 (-67.44%)
Mutual labels:  tween
Godot-WorldMaker
Fantasy world creator made with Godot for fun
Stars: ✭ 73 (+69.77%)
Mutual labels:  godot
PimplePopper
Game to pop pimples using the awesome Godot Engine
Stars: ✭ 23 (-46.51%)
Mutual labels:  godot
GDGotm
Official Godot plugin for gotm.io - the Godot Platform!
Stars: ✭ 43 (+0%)
Mutual labels:  godot
godot-psx-style-demo
Demo project featuring a collection of PS1 style shaders and materials for Godot engine.
Stars: ✭ 266 (+518.6%)
Mutual labels:  godot

GDAction

GDAction

This is plugins support make animation in godot, easy to learn, fast to code.

I have used SKSprite and Cocos game engines and I am extremely impressed with the “Action” in these engines.

It's similar to Godot's Tween, but easy to use, simple syntax, I liked it very much.

So I have remake this feature on Godot, you can use it completely for free.

You can use it to code some simple animations, with just a few simple lines of code.

Update 1.0.3 (29/10/21)

Change logs vs 1.0:

  • Fix bug crash when use reverse action

  • Add ease function: ex:

gd.move_to_x(end_x_position, 2.0).with_easing(gd.ease_func.ease_in).start($Sprite2)
  • Fix bug crash of action repeat when the node was free before the action complete.

  • Handle preview demo.

  • Now, action perform can pass param.

Installation

This is a regular editor plugin. Copy the contents of addons/godot-action into the same folder in your project, and activate it in your project settings.

If you want to know more about installing plugins you can read the official documentation page.

Demo Code:

Download source code and run demo

How to create 1 action, use keyword gd and call func create, ex: I create 1 action move by x:

# ex: I create 1 action move_by_x 100 pixel with duration = 1.0s
var action = gd.move_by_x(100, 1.0)

How to start action on Node:

action.start(node)

A group action has multiple child actions. All actions stored in the group begin executing at the same time.

gd.group([
  gd.move_to(target_position, 0.5),
  gd.rotate_by(360, 0.5)
]).start(node)

group

A sequence action has multiple child actions. Each action in the sequence begins after the previous action ends.

gd.sequence([
  gd.move_to(target_position, 0.5),
  gd.rotate_to(360, 0.5)
]).start(node)

sequence

You can use different types of time funcs: linear, ease_in, ease_out, ease_in_out, ease_out_in or custom time func with Curve.

# linear
gd.move_to_x(end_x_position, 2.0).start($Sprite)

# ease_in
gd.move_to_x(end_x_position, 2.0).with_easing(gd.ease_func.ease_in).start($Sprite2)

# custom time func with curve
gd.move_to_x(end_x_position, 2.0).with_time_func(custom_curve).start($Sprite3)

ease

Action

Animating

# Animate linear node movement.
func move_to(target_position: Vector2, duration: float) -> GDAction

func move_to_x(x: float, duration: float) -> GDAction

func move_to_y(y: float, duration: float) -> GDAction


func move_by(vector: Vector2, duration: float) -> GDAction

func move_by_x(x: float, duration: float) -> GDAction

func move_by_y(y: float, duration: float) -> GDAction


# Animating the Rotation of a Node
func rotate_by(by_angle: float, duration: float) -> GDAction

func rotate_to(to_angle: float, duration: float) -> GDAction

# Animating the Scaling of a Node
func scale_by(scale: float, duration: float) -> GDAction

func scale_by_vector(vector_scale: Vector2, duration: float) -> GDAction


func scale_to(scale: float, duration: float) -> GDAction

func scale_to_vector(vector_scale: Vector2, duration: float) -> GDAction

# Animating the Transparency of a Node
func fade_alpha_by(alpha_value: float, duration: float) -> GDAction

func fade_alpha_to(alpha_value: float, duration: float) -> GDAction


# Creates an animation change color.
# Func colorize change color only node.
func colorize(color: Color, duration: float) -> GDAction:

# Func colorize_all change color node and child node.
func colorize_all(color: Color, duration: float) -> GDAction

Removing a Node from the Scene

func remove_node() -> GDAction:

Chaining Actions

Actions can be chained together in multiple ways:

A sequence action has multiple child actions. Each action in the sequence begins after the previous action ends.

A group action has multiple child actions. All actions stored in the group begin executing at the same time.

A repeating action stores a single child action. When the child action completes, it is restarted.

To delay a subsequent action in the chain, insert a wait action in the sequence, and remember that groups, sequences, and repeating actions may be nested.

func group(list_action: Array) -> GDActionGroup

func sequence(list_action: Array) -> GDAction

func repeat(action: GDAction, count: int) -> GDAction

func repeat_forever(action: GDAction) -> GDAction

Delaying Actions

# Creates an action that idles for a randomized period of time.
func wait(time: float, with_range: float = 0.0) -> GDAction

Creating Custom Actions

# Call func from node
func perform(selector: String, on_target: Node, args: Array = []) -> GDAction

# Creates an custom action that executes a func over a duration.
func custom_action(selector: String, on_target: Node, duration: float) -> GDAction

# Run and wait action on other node.
func run(action: GDAction, on_target: Node, is_waiting_finished: bool = true) -> GDAction

Controlling Node Visibility

func hide() -> GDAction

func unhide() -> GDAction

Reversing an Animation

This method always returns an action object; however, not all actions are reversible. When reversed, some actions return an object that either does nothing or that performs the same action as the original action.

func reversed() -> SKAction

Config property action

func with_delay(delay: float) -> GDAction:

func with_speed(speed: float) -> GDAction:

func with_time_func(time_func: Curve) -> GDAction:

func with_easing(ease_func_value: float) -> GDAction:

ease func cheat sheet:

ease_func

sample code:

gd.move_by_x(300, 1.0).with_easing(2.0).start(node)

gd.move_by_y(200, 1.0).with_time_func(custom_curve).start(node)

Control action on a node

Pause, resume, cancel and finish action.

# pause
func pause_all_action()

func pause_all_action_on_node(node: Node)

func pause_action_on_node(node: Node, action: GDAction)

# resume
func resume_all_action()

func resume_all_action_on_node(node: Node)

func resume_action_on_node(node: Node, action: GDAction)

# cancel
func cancel_all_action()

func cancel_all_action_on_node(node: Node)

func cancel_action_on_node(node: Node, action: GDAction)

# finish
func finish_all_action()

func finish_all_action_on_node(node: Node)

func finish_action_on_node(node: Node, action: GDAction)

sample code:

gd.cancel_all_action_on_node(node)

Note that the action will be automatically released when the action is done. So if you use pause, you have to use resume to make it work again to free up memory, in case you want to stop the action and not resume, you should use cancel or finish.

Contribution

Contributions are welcome and are accepted via pull requests.

License

MIT License

Copyright (c) 2021-present, Duong Vi Tuan

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].