Skip to content
vkbsb edited this page Mar 8, 2015 · 5 revisions

Welcome to the godot_sam wiki!

How to Start

  • Download the zip of the repo or clone it into the modules directory of GoDot Engine source directory.
  • Compile the code. Once you compile it successfully.
  • you will see a "SuperAnimNode" under Nodes, add it to the scene.
  • download the sample sam files and Converter from https://github.com/raymondlu/super-animation-samples
  • Now select the SuperAnimNode and attach a script with following code.

`

#load the attack_front animation.
load_anim("res://attack_front/attack_front.sam"); 

#print the stage width/height
print("Width: " + str(get_width()) + " Height: " + str(get_height())) 

#check if a particular animation is preset
print("HasSection: " + str(pAnimNode.has_section("active")))

#to change weapon / gun use replace_sprite function 
#replace_sprite("res://originalspritepath", "res://newspritepath") example 
replace_sprite("res://attack_front/attack_front_60x135.png", "res://attack_front/sword_new.png")

#play the animation in a loop.
play_section("attack", true) 

`

You can set the sam file to load for a node by selecting the node and setting the SuperAnim property under inspector tab. You can then just put int he label name for animation to see it play in the editor.

Clone this wiki locally