Hiya.
So imagine if you could have a super-swish GUI pop up in relation to the position of a character. How would one go about doing this?
It seems to me that the issue is GUI positions being based on screen coordinates whereas character positions are based on room coordinates. So
gGUI1.X=cCHAR1.x+15;
gGUI1.Y=cCHAR1.y-15;
gGUI1.Visible=true;
doesn't manage to display the GUI at all.
Any help appreciated. Ta!
Whenever you want to convert room coordinates to screen coordinates, use Viewport:
gGUI1.X = cCHAR1.x - GetViewportX() + 15;
gGUI1.Y = cCHAR1.y - GetViewportY() - 15;
It seems strange that it won't display at all. How is it triggered? Is it supposed to follow the character around, using repeatedly_execute () ?
Viewport is only a position issue in scrolling rooms, it shouldn't prevent it from displaying completely.
Quote from: Andail on Tue 05/11/2013 08:16:30
It seems strange that it won't display at all.
Right... maybe the GUI type is incompatible with this task, like "popup when mouse is at Y"?
I could get the GUI to pop up when I specified just room coordinates, but when character coordinates were specified it didn't appear anywhere.
At least, it didn't *seem* to. There's a slight chance I was a massive idiot and it was displaying off-screen, as it's a scrolling room.
I'll check this when I get back from the office later on. Thanks folks!