Age | Commit message (Collapse) | Author |
|
There was too much fractional math happening at once resulting in
artifacts like nodes sharing the same position jiggling relative to
eachother as they moved. Instead compute the various values discretely,
flooring their values.
This also integrates the node origin, which previously was ignored.
A clamp has also been added to prevent zero-size nodes in rect w or h when
their AABB dimensions are non-zero.
|
|
A way to specify how the node's position relates to the node's
AABB rather than always being centered.
An origin of -1,-1 would place position at the bottom left corner
of the node's AABB, and +1,+1 the top right corner.
|
|
Starting to get an inkling of a need for a more hierarchical structure for
the stage. Something which allows arbitrary grouping of nodes which can
then be moved around and even scaled as one at the parent.
|
|
|
|
It's desirable to be able to fit dimensions to an aspect ratio prior
to stage creation. Since stage creation requires an SDL2 Renderer,
it must already have the window etc. Turn this into a lower level
helper for fitting so the window can be sized before creating the
renderer from it.
Should probably name it differently, but this is fine for now.
|
|
Convenient for whole-stage fades...
|
|
|
|
Leaving the existing node aabb semantics as both sizing and placing the
node relative to the stage size and its center, add a simple means of
statefully shifting the aabb.
When the position is left unset, it's 0,0, and effectively a noop leaving
the aabb to exclusively size and place the node. If you treat the aabb
as purely sizing the node, treating it as centered at 0,0 then you can
exclusively use this position api for placement of the node.
|
|
This code was used in whale [1], and prior to that was used in
a smaller project called mal. Since I seemed to be doing a lot of
reusing and building upon this, it seemed prudent to just stick it
in a repo as a .a I could submodule in future SDL2 art projects.
There are some kludges in this code currently, which will be fixed up
in time.
|