Quote: "Orvillian, are there plans to make percentage mode an option? I have a few work-in-progress apps that I would like to use with the Visual Editor without re-writing a bunch of placement code."
I finally had some time to set down and look at the Visual Editor libraries and see about making this work in percentage mode. So I thought I would share what I changed so it might help others:
How to use the new Visual Editor in Percentage Resolution mode:
In Visual Editor_globals.agc make the following changes to the VisualEditor_Setup function:
Comment out
SetVirtualResolution ( VisualEditor_Width, VisualEditor_Height )
If you do not have the percentage aspect already setup, go ahead and put it here using your desired width & height:
SetDisplayAspect(width/height)
In VisualEditor_load.agc make the following changes to the VisualEditor_ParseEntityData function:
Add
using your desired width, to the end of the following line of code:
if name = "x" then VisualEditor_Entities [ VisualEditor_Entities.length ].x = val ( data )
For example, it should now look like:
if name = "x" then VisualEditor_Entities [ VisualEditor_Entities.length ].x = val ( data ) * (100.0 / 360)
Add
using your desired height, to the end of the following line of code:
if name = "y" then VisualEditor_Entities [ VisualEditor_Entities.length ].y = val ( data )
For example, it should now look like:
if name = "y" then VisualEditor_Entities [ VisualEditor_Entities.length ].y = val ( data ) * (100.0 / 640)
Add
using your desired width, to the end of the following line of code:
if name = "size x" then VisualEditor_Entities [ VisualEditor_Entities.length ].sizeX = val ( data )
Change the following line of code:
if name = "size y" then VisualEditor_Entities [ VisualEditor_Entities.length ].sizeY = val ( data )
To the following:
if name = "size y" then VisualEditor_Entities [ VisualEditor_Entities.length ].sizeY = -1
Notes:
Be sure aspect ratio is a float.
These instructions only address sprite size & position, but you may need to change the scale & offset assignments if you use those too.
You can use similar changes for other objects, such as for text, you would change the code to:
if name = "text size" then VisualEditor_Entities [ VisualEditor_Entities.length ].textSize = val ( data ) * (100.0 / height)
I wanted to use the globals "VisualEditor_Width" & "VisualEditor_Height" to make it more dynamic, but those are not defined properly at the point where we are changing the x, y values.
I'm sure there is a more elegant way to do this, but maybe this will help until TGC makes this an official option