Here is a simple piece of code to enable you to drag your buttons to the position on the screen when designing your project.
Just replace the variable 'ButtonID' with your button ID ( or change the code to go through a loop etc. ) and put the code inside your main loop.
You will have to change the effect of clicking on the buttons within your code so it doesn't keep on activating a command etc.
It is best to use this code at the beginning, before you have linked your buttons to any events etc.
I know the Studio version has this built in, but I have had a few problems with the button arrangement and this is short, simply and cleaner in my view
INSTRUCTIONS
Just click on a button with the left mouse button and drag to where you want your button on your screen and make a note of the positions of the button on the screen to put into your code.
if GetVirtualButtonState(ButtonID)
PosX=ScreenToWorldX(GetRawMouseX())
PosY=ScreenToWorldY(GetRawMouseY())
SetVirtualButtonPosition(ButtonID,posX,posY)
print("posX:"+str(posX)+" posY:"+str(posY))
endif
I would like to add that this could be easily adapted to position other elements such as sprites, edit boxes, text positions etc.
You could also save the positions to a csv file to be read in to your project and align all your elements and make it easier when designing.
Amazing creations start with a Fuzzy Vision
Dave - Creator, Developer and Visionary
Fuzzy Visions