Reading Time: 4 minutes

I have been discovering a few bugs in regards to the Animation Editor and how 2D animations are handled within Game Pencil.

The following is an addition to the changes listed in our previous post here.

The Past

Previously I was using collision data as a point of pivoting the offsets of how the Animation/Sprite is drawn. For rotations, collision checking and scaling/skewing this resulted in weird bugs.

Current Build

Animtion2d Class Changes

Currently I have added a new enum class called animation2d_align with the following properties/options:

dir_top_left = 0,
dir_top_center = 1,
dir_top_right = 2,
dir_middle_left = 3,
dir_middle_center = 4,
dir_middle_right = 5,
dir_bottom_left = 6,
dir_bottom_center = 7,
dir_bottom_right = 8,

This will has resulted in setup_animation and setup_fullimg_animation to now include the animation2d_align animAlign = animation2d_align::dir_top_left parameters.

I have also created the
virtual void set_alignment( animation2d_align animAlign ) function that will modify our new variables for PROTECTED offset/pivoting of the animation2d class (int animation_offset_x, animation_offset_y ).

In the event you need to check what these numbers are you can use the public functions int get_xoffset and int get_yoffset(). These are different from the already get_frame_xoffset and get_frame_yoffset() functions.

Animtion2d Editor Class Changes

2D animation with new render point(Currently center/bottom aligned)

A drop down will be available in editor from 1.6X and beyond to pick which animation2d_align does this specific animation2d utelize. IF it is left unselected it will default to the project's default animation2d_align.

A checkbox will be be available to select if you will like to preview the animation_offset_x, animation_offset_y of your animation. I currently made a new function within standardEditableGameResource class called
virtual void render_axis_2d(nt x_pos, int y_pos, bool render_sphere, gpe::shape_rect view_space, gpe::shape_rect cam) that currently draws an X/Y labeled axis and a circle around this area.

Lastly as the header image displays you can now play with previewing your animation drawn as a quad within the editor by simply clicking within the Work area four differnt points. You may click as much to your liking as it moves based on last 4 clicks.

Animation2d Quad Pointed rendering

Project Properties Changes

-A drop down will be available for your project's default's animation2d_align for every new animation2d created. Imported projects older than 1.6X will be given dir_top_left as the default value.

Editor Settings Changes

--A drop down will be available for your future project's default's animation2d_align for every new animation2d created.

The Future

Animation 2D Editor

The Animation 2D Editor will begin to feature more cool effects for playing with your 2d animations.

PawGUI's changes

Currently in pawgui this is resulting in the resourcebar to render animations using the correct offsets, but some ui elements will need to account for these offsets as they were expected to all be top-left alignments in previous versions. I will begin QA on these ui elements in the future as these changes are not drastic enough to just tell IMGUI to take over this aspect.

Features Creeping avoided

Simiilar to our last post, I will like to document features that were creeping in my mind, but avoided for the sake of time and resource management:

Natively supporting Spine2d and similar choices

Every now and then this feature is suggested;however at the current moment it is not being added. The reason being, Game Pencil was meant to perform up to par for 2D in regards is meant to indeed allow rotation of textures and animations; but at the user's discretion. Suporting Spine2d and similar offerings is not on the books as it currently is not apart of an upcoming project.


Thank you to Kenney.nl for these wonderful animations.

That's all for today.