Autofit with a difference

Monkey Forums/Monkey Code/Autofit with a difference

chrisc2977(Posted 2014) [#1]
Im working on an autofit module that will allow you to set virtual resolutions at the start, and after that you will just use normal mojo functions as usual and it will dispay in the set resolution instead (things like MouseX() and SetScissor() will also return results based on the virtual resolution)
Im trying to do without changing mojo.

e.g
Import mojo
Import autofit

Class Game Extends App
	Method OnCreate()
		SetUpdateRate(60)
                'This is the only function needed to use different virtual resolutions
		SetVResolution(800, 400)
	End Method
	
	Method OnUpdate()
		
	End Method
	
        'Will automatically draw at the virtual resolution
	Method OnRender()
		Cls(100, 100, 100)
		DrawText(TouchX() + "," + TouchY(), 0, 0)
	End Method
End Class

Function Main()
	New Game
End Function



Im nearly there :) although it does require one small change to mojo that I hope Mark will add :)