SMBXRaptor wrote:i think we dont need this , wohlstand already make best animator and npc editor
SMBXRaptor, he start this tool before I made my editor possible to save files, also I don't object for this. My editor is a huge part of developing project and "Photoshop" for SMBX, and this tool is a NPC.txt specific editing. Also we with Luigifan2010 are cooperate
Luigifan2010,
I can adapt my NPC animator into С#, but I need for tiny help with C# environments:
- How to define dynamic array of bitmaps?
- how to crop bitmap into pieces and I wanna store them into array
I will give to you list of variables and functions which you should to define, and I will write contents for make it working.
Functions
void setAnimator()
function should:
- clear current framelist
- set animation properties into special variables
- crop source image into pieces
- set timer settings and set call "next Frame" function each timeout
Function should have access to "merged" NPC's config. I.e. merged INI with NPC.txt
This function should be re-Called by change of GFX width/height, frame-style and frame-speed. (before apply new changes, timer should be stopped)
void setFrame(int)
function should change current frame by accepted index (0 - is first frame) and refresh view of displayed animation
void nextFrame() -
this function should be called by timer. This is a calculator of next frame.
Variables and arrays
List<bitmap> frames - bitmaps dynamic array. Will have inside them frames.
int CurrentFrame - index of frame which displaying now
int frameCurrent; - calculating frame. Using by nextFrame() function
int frameSpeed - value in milliseconds, this is a timer value
int frameStyle - same from config
int direction - current direction (-1 or 1)
bool aniDirect; - Directed animation. I.e. left and right directions will define animation direction (reverse or direct)
bool aniBiDirect; - Bidirectional animation. I.e. animation direction will turn on last frame and will turn after return into first frame.
int curDirect; - direction of animation, I.e. direct or reverse animation.
int frameStep; - How many frames will be forwarded by one animation step. (defaultly 1, but if enabled algorithm "frameJump", this value can be redefined)
bool customAnimate;
int customAniAlg; //custom animation algorythm 0 - forward, 1 - frameJump, 2 - animation by frame sequance
int custom_frameFL;//first left
int custom_frameEL;//end left / jump step
int custom_frameFR;//first right
int custom_frameER;//enf right / jump step
bool frameSequance; - animation will go by predefined animation sequance\
List<integer> frames_list - dynamic array of INT degits which a frames indexes. This array Defining the frame sequance.
int framesQ; - total frames in sprite (calculating by dividing of sprite height to gfx height value)
int frameSize; // size of one frame - gfx height
int frameWidth; // sprite width
int frameHeight; //sprite height - height of source image
//Animation alhorithm
int frameFirst; - index of first frame (defining by setAnimation() and using by "nextFrame")
int frameLast; - index of last frame (if value -1, last frame is a last frame which stored into array)