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

Author Topic: How to create a build menu with the SFML view  (Read 4173 times)

0 Members and 1 Guest are viewing this topic.

Mitmischer 1703

  • Newbie
  • *
  • Posts: 8
    • View Profile
How to create a build menu with the SFML view
« on: May 01, 2011, 12:15:52 pm »
Hi!

I'm having trouble creating a build menu like that one shown in this picture (http://www.mobygames.com/images/shots/l/282897-supreme-commander-forged-alliance-windows-screenshot-new-hud.png).

I've figure a view would do the the job, but I cannot imagine how this works. Can anyone give me the basic idea how to do it?

Groogy

  • Hero Member
  • *****
  • Posts: 1469
    • MSN Messenger - groogy@groogy.se
    • View Profile
    • http://www.groogy.se
    • Email
How to create a build menu with the SFML view
« Reply #1 on: May 01, 2011, 01:48:00 pm »
A view defines what is viewed in a rendering target, like a camera. So I don't think that's what you are looking for.

Seems more and more people are assuming views does, err what is is called? :?  Scene clipping? Or something? :?
Developer and Maker of rbSFML and Programmer at Paradox Development Studio

Mitmischer 1703

  • Newbie
  • *
  • Posts: 8
    • View Profile
How to create a build menu with the SFML view
« Reply #2 on: May 01, 2011, 03:01:11 pm »
hey there, you are absolutly right. So, what should I do instead?

Nexus

  • SFML Team
  • Hero Member
  • *****
  • Posts: 6287
  • Thor Developer
    • View Profile
    • Bromeon
How to create a build menu with the SFML view
« Reply #3 on: May 01, 2011, 03:07:25 pm »
First draw the scene and then the menu on top of it?
Zloxx II: action platformer
Thor Library: particle systems, animations, dot products, ...
SFML Game Development:

Fkscorpion

  • Newbie
  • *
  • Posts: 4
    • View Profile
How to create a build menu with the SFML view
« Reply #4 on: May 09, 2011, 06:38:18 pm »
Quote from: "Nexus"
First draw the scene and then the menu on top of it?


This!

I do it this way:



Code: [Select]
App->SetView(GameCam); (GameCam is a sf::view which can be moved by the user to look over the "battlefield")

App->Clear();  (Clear the window...)

Game->DrawAllTheThingsHappeningInTheGame();

App->SetView(App.GetDefaultView()); (The DefaultView does not move and so it allways "lays" over your GameCam and can draw all Hud elements)

Game->DrawTheHud();

App->Display();




Pseudocode btw. :P

Mitmischer 1703

  • Newbie
  • *
  • Posts: 8
    • View Profile
How to create a build menu with the SFML view
« Reply #5 on: May 15, 2011, 06:51:45 pm »
hi, thanks for your answers!

So I have to determine the coodinates manually, or can I set an alignment?

 

anything