-
Notifications
You must be signed in to change notification settings - Fork 90
exercise_5
As shown in the first exercise set, images can have a text based backing store, an image based backing store, or a simple colour. The 'backing store' though is not strictly coupled to one video object, they are reference counted and can be shared.
Sharing image stores is a very simple yet efficient way of reducing memory use and to make drawing more efficient as it reduces the number of state transitions that are needed to render something.
Load an image asynchronously from a file. Create a null_surface and print the results from using image_matchstore on these two objects. Then use image_sharestorage and repeat the comparison. Then Create a _tick event handler and destroy the loaded image after a certain number of ticks.
For some extra fun, try sharing WORLDID to the null surface.
Load an image asynchronously from a file, preferably one with the picture of a dog or something equally awesome and easy to see. Create 3 other null surfaces that share storage with the image when loaded. Position them so that there is a one pixel gap. Split it up so that the each surface shows a different quadrant of the same source.
Hint: image_set_txcos is your friend.
Start with 4 fill_surface colored boxes, keep them invisible. Create and show a null_surface and use image_framesetsize along with set_image_as_frame attached to populate the different slots.
Continue with the frameset from exercise three. Add an input handler that uses the arrow keys to interactively step which the active frame is. Look at image_active_frame.
Continue with the frameset from exercise three. Try and use image_framecyclemode to make it animate automatically.
Time to combine the lessons learned so far. Scour the internet for a 'sprite sheet' in a friendly image format but as a single image file. Try and convert that image into a correctly animated cycle.