we work with object all the time, but originally they start from the top left. we look to put our start point in the center of an object.
starting by creating a new project & a reusable Entity class. putting an x, y, width & height inside.
we then code out a ShapeObject that uses the Entity class. next, we make an ImageObject class which also uses the Entity class & make sure that the image affects the width & height.
our last class is FontObject also using the Entity class, using the fonts string & size to affect the width & height.
we then create a grid to show how the objects are rendered using the center point.
source code:
https://github.com/lewislepton/kha-tutorial-series
commit source:
https://github.com/Kode/Kha/tree/4efbe1e8dfaf4c1a21ef5f51bae9f4638dabee6c
SUPPORT ON PATREON FROM AS LITTLE AS $1:
https://patreon.com/lewislepton
intro & outro music is from this EP:
https://lewislepton.bandcamp.com/album/coat-noise-ep
like, share & subscribe to stay up to date.
https://lewislepton.com
https://patreon.com/lewislepton
https://twitter.com/lewislepton
https://facebook.com/lewislepton
https://lewislepton.bandcamp.com
https://soundcloud.com/lewislepton
https://github.com/lewislepton