Jump to content

How to add UI graphics on top of complex game world


JakeCake
 Share

Recommended Posts

I would like to place my UI elements on top of all other sprites/groups. My current approach was to add a new group, place this on top of everything else and set fixedToCamera = true, but this gives me a weird result.

 

Everything in this group does seem to be placed differently, and more fixedToCamera than some other stuff, but all the transformation I've done to the master "world" group seem to also apply to this group. How can I truly add UI graphics to the game without any previous matrices/translations applied to them, so they are placed solely in camera-space.

 

I realise I could add another layer of group over everything else and then treat one of them as the world, and have everything but UI in this group, but that would leave me with two groups called "world". Though, this is going to be my solution unless there's an easy fix available.

 

Perhaps I am just using fixedToCamera wrong?

Link to comment
Share on other sites

You should probably add 2 groups to the game

1. uigroup

2. worldgroup

 

make the uigroup elements fixed to camera and add all world related groups to the worldgroup, and make sure you transform the worldgroup

 

I thought so, it just seems really weird to me that something "fixedToCamera" would be transformed with the world. Guess I'll have to do it this way, which isn't much of a problem if only I had known from the start. I was hesitant because this is going to be problematic this far into the development process. Anyways, I'll get right on it, thanks for the answer.

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...