Yah, setting the position manually is way easier than any other way.
Also, here's a quick example how I go about setting up my projects with the percentage system(hope it helps you):
main.agc file:
// Load Extension Files **********************
#Insert "settings.agc" `settings extension file
#Include "functions.agc" `functions extension file
// Load / Set Game Settings ******************
LoadSettings( "settings.ini" )
SetWindowSettings()
SetVSync( vsync )
SetResolutionMode( resolutionmode )
// Main Game Loop *************************
Do
Print( ScreenFPS() )
Sync()
Loop
settings.agc file:
// ********************************************
// Settings Extension File
// ********************************************
// Base Settings ******************************
GLobal title$ as String `game title
Global version$ as String `current game version
Global window as Integer `window mode on / off
Global winx as Integer `window resolution x
Global winy as Integer `window resolution y
Global aspect# as Float `window aspect ratio
Global orientation$ as String `orientation type
// Graphics Settings **************************
Global vsync as Integer `vsync setting - on / off
Global resolutionmode as Integer `use high / low resolution screen
Global graphicsmode$ as String `graphics mode / settings
// Sound Settings *****************************
Global sound# as Integer `sound volume variable
Global music# as Integer `music volume variable
// App Settings *******************************
Global appmode$ as String `current application mode
Global control$ as String `control scheme mode
Global readfile$ as String `string for reading settings file
functions.agc file:
// ********************************************
// Functions Extension File
// ********************************************
// Settings Functions *************************
Function LoadSettings( file$ )
If GetFileExists( file$ ) = 1 `check for settings file
settings = OpenToRead( file$ ) `open settings file
For f = 1 to 100 `cycle through settings file
readfile$ = ReadLine( settings ) `read line
// base settings ************************************************
`title
If GetStringToken( readfile$ , ":" , 1 ) = "title"
title$ = GetStringToken( readfile$ , ":" , 2 )
Endif
`version
If GetStringToken( readfile$ , ":" , 1 ) = "version"
version$ = GetStringToken( readfile$ , ":" , 2 )
Endif
`fullscreen
If GetStringToken( readfile$ , ":" , 1 ) = "fullscreen"
window = Val( GetStringToken( readfile$ , ":" , 2 ) )
Endif
`screen x resolution
If GetStringToken( readfile$ , ":" , 1 ) = "rezx"
winx = Val( GetStringToken( readfile$ , ":" , 2 ) )
Endif
`screen y resolution
If GetStringToken( readfile$ , ":" , 1 ) = "rezy"
winy = Val( GetStringToken( readfile$ , ":" , 2 ) )
Endif
`aspect ratio
If GetStringToken( readfile$ , ":" , 1 ) = "aspect"
aspect# = ValFloat( GetStringToken( readfile$ , ":" , 2 ) )
Endif
`orientation mode
If GetStringToken( readfile$ , ":" , 1 ) = "orientation"
orientation$ = GetStringToken( readfile$ , ":" , 2 )
Endif
// graphics settings ************************************************
`vsync settings
If GetStringToken( readfile$ , ":" , 1 ) = "vsync"
vsync = Val( GetStringToken( readfile$ , ":" , 2 ) )
Endif
`resolution mode
If GetStringToken( readfile$ , ":" , 1 ) = "resolutionmode"
resolutionmode = Val( GetStringToken( readfile$ , ":" , 2 ) )
Endif
`graphics mode
If GetStringToken( readfile$ , ":" , 1 ) = "graphicsmode"
graphicsmode$ = GetStringToken( readfile$ , ":" , 2 )
Endif
// sound settings ***************************************************
`sound volume
If GetStringToken( readfile$ , ":" , 1 ) = "sound"
sound = Val( GetStringToken( readfile$ , ":" , 2 ) )
Endif
`music volume
If GetStringToken( readfile$ , ":" , 1 ) = "music"
music = Val( GetStringToken( readfile$ , ":" , 2 ) )
Endif
`app mode
If GetStringToken( readfile$ , ":" , 1 ) = "appmode"
appmode$ = GetStringToken( readfile$ , ":" , 2 )
Endif
`control scheme
If GetStringToken( readfile$ , ":" , 1 ) = "control"
control$ = GetStringToken( readfile$ , ":" , 2 )
Endif
`null
If readfile$ = "null"
Exit
Endif
Next f
CloseFile( settings ) `close settings file
Endif
EndFunction
// Game / App Window Settings ******************
Function SetWindowSettings()
SetWindowTitle( title$ + " " + version$ )
SetWindowSize( winx , winy , window )
SetDisplayAspect( aspect# )
If orientation$ = "portrait" Then SetOrientationAllowed( 1 , 1 , 0 , 0 )
If orientation$ = "landscape" Then SetOrientationAllowed( 0 , 0 , 1 , 1 )
EndFunction
settings.ini file, place in the media folder in your project directory:
title:My Game Template
version:0.1a
fullscreen:0
rezx:1024
rezy:768
aspect:1.333
orientation:landscape
-------------------------
vsync:1
resolutionmode:1
graphicsmode:high
-------------------------
sound:75
music:65
-------------------------
appmode:startup
null
You can use this as a template for your game, or just pick and choose what to grab from it. Hope it helps!
Let me know if anything needs explaining, tried to put in as much detailed comments as possible. Good luck!