Dear Cerberus X User!
As we prepare to transition the forum ownership from Mike to Phil (TripleHead GmbH), we need your explicit consent to transfer your user data in accordance with our amended Terms and Rules in order to be compliant with data protection laws.
Please read the new Terms and Rules below, check the box to agree, and click "Accept" to continue enjoying your Cerberus X Forum experience. The deadline for consent is April 5, 2024.
Do not accept the amended Terms and Rules if you do not wish your personal data to be transferred to the future forum owner!
Accepting ensures:
- Continued access to your account with a short break for the actual transfer.
- Retention of your data under the same terms.
Without consent:
- You don't have further access to your forum user account.
- Your account and personal data will be deleted after April 5, 2024.
- Public posts remain, but usernames indicating real identity will be anonymized. If you disagree with a fictitious name you have the option to contact us so we can find a name that is acceptable to you.
We hope to keep you in our community and see you on the forum soon!
All the best
Your Cerberus X Team
Strict
Import mojo2
' Set the parameters for a GLFW window, to make it resize visually.
#GLFW_WINDOW_WIDTH = 800
#GLFW_WINDOW_HEIGHT = 400
#GLFW_WINDOW_RESIZABLE = True
#GLFW_WINDOW_RENDER_WHILE_RESIZING = True
'Set the Android screen to landscape and let the user choose orientation for that.
#ANDROID_SCREEN_ORIENTATION="sensorLandscape"
' The size of our virtual window. This is the resolution you work with while rendering.
Const VWIDTH:Int = 320
Const VHEIGHT:Int = 240
Global viewW:Int = 200
Global viewH:Int = 100
Class MyApp Extends App
Field myCanvas:Canvas
Method OnCreate:Int()
myCanvas = New Canvas()
viewW = DeviceWidth()
viewH = DeviceHeight()
Return 0
End
Method OnUpdate:Int()
If KeyHit(KEY_UP)
viewW += 10
viewH += 10
Print(viewW + " " + viewH)
Endif
If KeyHit(KEY_DOWN)
viewW -= 10
viewH -= 10
Print(viewW + " " + viewH)
Endif
If KeyHit(KEY_SPACE)
viewW = DeviceWidth()
viewH = DeviceHeight()
Endif
Return 0
End
Method OnRender:Int()
myCanvas.SetViewport(0, 0, viewW, viewH)
myCanvas.SetProjection2d(0, VWIDTH, 0, VHEIGHT)
'Here goes your drawing routine:
myCanvas.Clear($c96d36)
myCanvas.DrawText(VWIDTH + "x"+ VHEIGHT + " on " + viewW + "x" + viewH, VWIDTH/2, VHEIGHT/2, 0.5, 0.5)
myCanvas.Flush()
Return 0
End
End
Function Main:Int()
New MyApp
Return 0
End
#HTML5_CANVAS_WIDTH=1920 'Set the width of the canvas.
#HTML5_CANVAS_HEIGHT=1080 'Set the height of the canvas.
Field cw: Int = 300
Field ch: Int = 150
Field canvas:Canvas
Const WIDTH:Int = 1024
Const HEIGHT:Int =768
Method OnCreate:Int()
'Set the update rate to 60 frames per second
SetUpdateRate(60)
canvas = New Canvas
cw = DeviceWidth()
ch = DeviceHeight()
canvas.SetViewport(0, 0, cw, ch)
canvas.SetProjection2d(0, WIDTH, 0, HEIGHT)
img = New Image(cw, ch)
img.SetHandle(0.0, 0.0)
dp = New DataBuffer(cw * ch * 4)
'Pyro set up
letterBox = prCalcLetterbox(WIDTH, HEIGHT,[0, 0, DeviceWidth(), DeviceHeight()])
guiLayer=New prGuiLayer()
guiLayer.SetProjection WIDTH,HEIGHT
guiLayer.SetAmbientLight 1,1,1,1
guiLayer.Renderer.SetClearMode 0
guiLayer.SetViewport letterBox[0],letterBox[1],letterBox[2],letterBox[3]
End
Method OnRender:Int()
letterBox = prCalcLetterbox(WIDTH, HEIGHT,[0, 0, DeviceWidth(), DeviceHeight()])
guiLayer.SetViewport letterBox[0], letterBox[1], letterBox[2], letterBox[3]
guiLayer.SetOverlay canvas
canvas.Clear
draw()
canvas.Flush()
guiLayer.Render
Return 0
End
Strict
#HTML5_CANVAS_WIDTH=1024 'Set the width of the canvas.
#HTML5_CANVAS_HEIGHT=768 'Set the height of the canvas.
Import mojo2
DeviceWidth()
DeviceHeight()
IF you added these after a first build, they don't get processed. You have to delete the build folder to have changed settings to be effective.For some reason it is not working, when I print the