Drawimage not working on Desktop, working on html5
Monkey Targets Forums/Desktop/Drawimage not working on Desktop, working on html5
| ||
I have a simple Field test:Image test = LoadImage ("test.png") and in render: DrawImage test,0,0,0 This works fine of course, but only in html5. In desktop, it doesn't show anything. How can that be? Is there anything I need to do keep in mind to make it work? Other things (that also use drawimage btw) are working in both targets. |
| ||
The code you provide should work. Is that all the code? Which desktop target do you use? |
| ||
It's on Mac |
| ||
The structure is: Class game Field test:Image Method OnCreate:Int () Local mode:DisplayMode = DesktopMode() SetDeviceWindow(mode.Width,mode.Height,1) test = LoadImage ("test.png") Return 0 End 'on create Method OnUpdate:Int () Return 0 End 'on update Method OnRender:Int () Cls 0,0,0 SetColor 255,255,255 DrawImage test,0,0,0 Return 0 End 'on render End 'class Function Main:Int () New game Return 0 End 'main |
| ||
You possibly need to call SetUpdateRate in OnCreate for Desktop target to refresh the display. |