Not sure it's clear from the docs, but you can't load images before creating a main 'window' canvas.
You also can't create an image canvas prior to creating the 'window' canvas.
Examples:
' OK!
' Main display canvas...
display = New Canvas
display.SetProjection2d 0.0, display.Width * SCALE, 0.0, display.Height * SCALE
' Load images...
boing = Image.Load ("boing.png", 0.5, 0.5, 0)
background = Image.Load ("background.png", 0.0, 0.0, 0)
' Scaled render target...
rendertarget = New Image (display.Width * SCALE, display.Height * SCALE, 0.0, 0.0, 0)
renderbuffer = New Canvas (rendertarget)
renderbuffer.SetProjection2d 0, display.Width, 0, display.Height
' Not OK...
' Load images...
boing = Image.Load ("boing.png", 0.5, 0.5, 0)
background = Image.Load ("background.png", 0.0, 0.0, 0)
' Main display canvas...
display = New Canvas
display.SetProjection2d 0.0, display.Width * SCALE, 0.0, display.Height * SCALE
' Scaled render target...
rendertarget = New Image (display.Width * SCALE, display.Height * SCALE, 0.0, 0.0, 0)
renderbuffer = New Canvas (rendertarget)
renderbuffer.SetProjection2d 0, display.Width, 0, display.Height
' Not OK!
' Scaled render target...
rendertarget = New Image (display.Width * SCALE, display.Height * SCALE, 0.0, 0.0, 0)
renderbuffer = New Canvas (rendertarget)
renderbuffer.SetProjection2d 0, display.Width, 0, display.Height
' Main display canvas...
display = New Canvas
display.SetProjection2d 0.0, display.Width * SCALE, 0.0, display.Height * SCALE
' Load images...
boing = Image.Load ("boing.png", 0.5, 0.5, 0)
background = Image.Load ("background.png", 0.0, 0.0, 0)
This is the project I'm playing with:
http://www.hi-toro.com/monkey/scaletest.zip
|