GLBasic forum

Main forum => GLBasic - en => Topic started by: ynbniar on 2009-Oct-31

Title: Sprite bigger than screen
Post by: ynbniar on 2009-Oct-31
I'm wondering what's wrong with this...nz1.bmp is larger than the screen size of 800x600 pixels, it is 2500x1900 or so...

Code (glbasic) Select

LOADSPRITE "nz1.bmp",0

x=0
y=0
width=800
height=600

loop:
IF KEY(200) THEN
IF y>7 THEN y=y-8
IF KEY(208) THEN
IF y<791 THEN y=y+8
IF KEY(203) THEN
IF x>7 THEN x=x-8
IF KEY(205) THEN
IF x<791 THEN x=x+8
DRAWSPRITE 0,-(x),-(y)
SHOWSCREEN
GOTO loop


Obviously only 800x600 of the bitmap is displayed at any time...where is the rest of the bitmap? Is GLBasic intelligently clipping or am I scrambling memory someplace?
Title: Re: Sprite bigger than screen
Post by: MrTAToad on 2009-Oct-31
It should be clipping to the current viewport rectangle.  If this isn't set, then the viewport is the screen resolution size