Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: Creating a "black box"  (Read 3798 times)

0 Members and 1 Guest are viewing this topic.

Zorgie

  • Newbie
  • *
  • Posts: 2
    • View Profile
Creating a "black box"
« on: December 14, 2007, 04:02:10 pm »
Hi, i'm kinda new to using SFML, and i might have missed this in the tutorial or past forum posts, which i have searched, but anyways, here goes:

I want to create some kind of black box on the screen, overlapping any images below it, alternatively get some kind of way in what order the sprites are showing on the screen, which ones getting priority to be shown if they are on the same spot.

Thanks

Merkoth

  • Guest
Creating a "black box"
« Reply #1 on: December 15, 2007, 09:18:50 pm »
Well, the order will be determined by the order in what you call the Draw() method.

for example:

Code: [Select]

// App is an instance of the RenderWindow object

App.Draw( myBackground );
App.Draw( myShip );
App.Draw( myExplosion );

// render
App.Display();


That would render the background on the... err... back, the ship over the background and, finally, the explosion over the ship. Think of it as Photoshop's Layers.

Now, I'm not really sure I understand what you mean by black box. You should be able to use a simple square image which you than assign to a sprite.

Hope this helps :)

Zorgie

  • Newbie
  • *
  • Posts: 2
    • View Profile
Ty
« Reply #2 on: December 19, 2007, 10:57:24 am »
Thanks, that helps :)

 

anything