-
Notifications
You must be signed in to change notification settings - Fork 8
CollageDrawer
Similar to the CanvasDrawer, this object draws surfaces, but it does it in a smart way.
The base for this object is the Collage Library by tabularElf.
He created a library with a great idea: Build entire texture pages at runtime. It is a good concept, and while we had to change lots of code in the library and fix many bugs, the core idea and the GPU- and render-mechanics of the library are great. At the time of writing this, we used a code base with version number 0.5, more or less a prototype, but it was all that was available, so we adapted it and integrated it into raptor.
In GameMaker, using sprite_add always creates a new texture page for the sprite. So, in a dynamic game, where you maybe load hundred sprites or more, you will have a hundred texture swaps per frame. This is going to kill your performance sooner or later and Collage targets exactly this problem: Put all those together on one texture page, thus removing dozens of texture swaps.
You create a compilation, a series of images, sprites, files, file strips, surfaces, even whole sprite-sheets with several rows and columns and multiple sprites on one sheet and images from the internet and the library will pack them together onto one single texture page (to be more exact: to as many texture pages as you tell it to).
This is the game object that brings your collages to life. It renders any sprite contained in any collage with only three variable definitions:
| Variable | Description |
|---|---|
draw_on_gui |
This variable should be well known to you from many other raptor objects. Of course, this objects lets you also select, whether it shall draw on the GUI event or in the world space |
collage_name |
The name of the collage to use |
sprite_name |
The name of the sprite in the named collage to render |
It's as easy as that!
In contrast to the original source code of collage, we removed many double definitions in the library. You work normally with the "green" variables, like image_speed, image_index, fps, image_angle and all those. Also the scaling is simply taken from the green variables, so you can place your drawer either directly in the room and apply the settings or you create it in code, or you just skin it. Yes! As the drawer is a raptor object, it is fully skinnable, respects themes and can even be initialized through the Raptor RichJson Format in a data file. This means, it can be hot-patched through a download from your game server without any restrictions.
Raptor free: Animation ● StateMachine ● Files(Sync) ● Macros ● Logger ● Controllers ● LG Localization ● Particle Effects ● Tools, other Objects and Helpers
Raptor pro: RACE (The Random Content Engine) ● Savegame System ● UI Subsystem ● Shaders ● Files(Async) ● RichJson ● Scriptor
Back to Repo ● Wiki Home ● Copyright © coldrock.games
- Home
- Working with raptor
- Create a Game
- raptor's object model
- Macros
- Logger
- Controllers
- StateMachine
- Animation
- Particle Effects
- LG Localization
- Interfaces
- Tools, other Objects and Helpers
Raptor Pro Modules