Skip to main content

Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines

GMRoomPack

Package GameMaker rooms and load them as you please · By YellowAfterlife

Prefab UI, and following the camera.

A topic by McKraken created Aug 21, 2023 Views: 183 Replies: 1
Viewing posts 1 to 2
(1 edit)

Hey, I've been using your GMRoomPack thing for a while now. For a new game I'm working on, I've decided to use your extension to handle the UI system of the game.

The UI is divided into multiple objects that are drawn on their own layer. They're put in prefabricated rooms that are loaded into the game upon called.

Works great, until you move the camera, and the UI doesn't exactly move with it.

I've seen the example for prefab UI in the itch page, and I'm wondering how you managed to get it to work. Do you have an example of that project or how the UI works in it?


Edit: Some more details.

The UI use the regular draw event (not Draw GUI). I've tried using Draw GUI as an alternative, which does make the UI move with the camera, but doesn't exactly scale with it.

Developer

GMRoomPack’s job is to place the things in the room, the rest is up to you.

Don’t think I still have the source files for that demo, but pretty sure I just moved the objects around based on xstart + camera_get_view_x(view_camera[0]). And if your camera rotates, you gotta do math (but also at that point you’ll probably have to switch to GUI + display_set_gui_size)