Setting custom Dialog GUI position based on players Y-position

Started by shaun9991, Tue 10/01/2017 12:18:50

Previous topic - Next topic

shaun9991

Hi guys,

I hope this is a simple question, any assistance is much appreciated. I have a custom dialog GUI (gSaying) for my main character, I'd like to test the dialog GUI (including the labels and portrait button) to appear at the top of the screen when the player is in the lower half of the screen, or the bottom of the screen when the player is at the top of the screen. I'm hoping I can do this with a simple if/else when calling the custom dialog GUI? Just not sure how to go about it. Note that the game features scrolling screens, some of which scroll up and down as well as left and right. The game res is 640x400. Any help much appreciated!

Thanks,

Shaun
Support Cloak and Dagger Games on Patreon: https://www.patreon.com/user?u=460039

Khris

You can calculate the player's screen position by subtracting GetViewportY() from player.y.
As for positioning the dialog GUI, the forum search gave this result: http://www.adventuregamestudio.co.uk/forums/index.php?topic=46705.msg628388#msg628388

shaun9991

Support Cloak and Dagger Games on Patreon: https://www.patreon.com/user?u=460039

SMF spam blocked by CleanTalk