Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

2D All the way! / images help

Author
Message
persian dragon
20
Years of Service
User Offline
Joined: 14th Jun 2006
Location:
Posted: 15th Jun 2006 04:16
I am trying to put sprite images onto a background image, but i do not understand why it is not working.

this is code i have so far: when i compile it, it just shows a blue screen with the background image on it.

`load images
load bitmap "background.jpg", 0

load image "srallycarstraight24.bmp", 2
load image "paddle.jpg", 3


set current bitmap 0
get image 2,0,0,96,96
sprite 2,2,2,2

wait key
Zergei
21
Years of Service
User Offline
Joined: 9th Feb 2005
Location: Everywhere
Posted: 15th Jun 2006 05:52
Let's see...
Quote: "load bitmap "background.jpg", 0"

loads that image and sets it as the background.
Quote: "load image "srallycarstraight24.bmp", 2
load image "paddle.jpg", 3"

those load srallycarstraight24.bmp as image number 2 , and paddle.jpg as image number 3
Quote: "set current bitmap 0"

sets bitmap 0(screen) as the viewable bitmap.
Quote: "get image 2,0,0,96,96"

grabs an 97x97 image from the current bitmap and saves as image number 2, thus overwriting the previus loading secuence of srallycarstraight24.bmp.
Quote: "sprite 2,2,2,2"

sets up a sprite as number 2, in x=2 and y=2, and image number 2, wich is somewhat the background.

So far, i think you'll see the background, and on the upper left corner and image of the background, but as its just 2 pixel lower and to the right, its hard to notice it. OH, and the blue screen is because of the sprite, since from some version of Db, sprites are treated like 3d objects. Im not really sure what your aiming to, so cannot help that much.

Login to post a reply

Server time is: 2026-07-04 11:44:53
Your offset time is: 2026-07-04 11:44:53