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.

DarkBASIC Discussion / Multilayered/transparent sprites

Author
Message
CaiF_R
21
Years of Service
User Offline
Joined: 25th Jan 2003
Location:
Posted: 28th Jan 2003 06:19
Is it possible to make a semi-transparent sprite ie. where a purple colour would result in transparentsy?? Iam going to use it for a 2d sidescroller where i would like a background to scroll and then a sprite (ie. buildings) ontop of the that would then again scroll with a different speed. And finally another sprite (ie. sidewalk). I could use some help on that too

Thanks
Cheers, CaiF_R.
CaiF_R
21
Years of Service
User Offline
Joined: 25th Jan 2003
Location:
Posted: 28th Jan 2003 07:15
Ohh I have figured out how to make part of the image transparent (using: paste image nr, X, Y, RGB(R,G,B) But how can i control wich images are drawn infront and behind other images/sprites?? Ie. if i want a sidewalk to scroll behind a sort of framing interface.

indi
21
Years of Service
User Offline
Joined: 26th Aug 2002
Location: Earth, Brisbane, Australia
Posted: 28th Jan 2003 07:45
in dbc its the sprite creation order.

in DBP u have a few more sprite layering commands at your disposal

CaiF_R
21
Years of Service
User Offline
Joined: 25th Jan 2003
Location:
Posted: 28th Jan 2003 08:30
Figured it out myself but thanks anyway
Maybe u could help me with some image scroll instead?
Is it possible to make a "endles" scroll??
If so how large/wide should the image be if it should fill the screen at a width of 800?

indi
21
Years of Service
User Offline
Joined: 26th Aug 2002
Location: Earth, Brisbane, Australia
Posted: 28th Jan 2003 09:47
Well u could use 2 that are 1.5 times the required size and then add new tiles to this process of flipping 2 cells.
the * is where the new tile is placed
the [ ] indicates the screen visible area
the diagram is shifting to the right if it makes sense.


______*[_____]___

IanM
Retired Moderator
21
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 28th Jan 2003 14:14
Depending on the size of your scroll area:

small: Use several sprites and move them to create the illusion of scrolling
larger: You'll probably want to put together a tiling system and redraw the screen each time using paste image for each tile, moving the the coords you draw at to make it seem to move.
IanM
Retired Moderator
21
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 28th Jan 2003 14:31
An example of a tile scroll:

CaiF_R
21
Years of Service
User Offline
Joined: 25th Jan 2003
Location:
Posted: 28th Jan 2003 21:24
Thanks for the help but i´ve actualy come up with an idea myself.. alot simpler but i havent fully tested is so i cant say if its more flexible



But thanks anyway
Cheers

CaiF_R
21
Years of Service
User Offline
Joined: 25th Jan 2003
Location:
Posted: 28th Jan 2003 21:27
Oops. Didt notice that lame inc. I could just have said
Inc x, 3 (easy to control the speed of different layers)



Cheers

indi
21
Years of Service
User Offline
Joined: 26th Aug 2002
Location: Earth, Brisbane, Australia
Posted: 29th Jan 2003 10:40
IanM
Retired Moderator
21
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 29th Jan 2003 14:01
If you have a look at the code, you'll see that we're basically doing the same thing, except I'm doing it with more images.

Login to post a reply

Server time is: 2024-05-04 22:21:28
Your offset time is: 2024-05-04 22:21:28