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

Author Topic: Using Multiple views  (Read 6927 times)

0 Members and 1 Guest are viewing this topic.

felipehenrique

  • Newbie
  • *
  • Posts: 8
    • View Profile
Using Multiple views
« on: January 24, 2011, 04:23:31 am »
Hello
I am creating a tile-based RPG and I have a doubt about scrolling the map. If I use the default view of the window, objects as hud go to scroll along. Is there any way to use multiple views to do this?
Thanks.

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Using Multiple views
« Reply #1 on: January 24, 2011, 07:36:59 am »
Of course, you can use as many views as you want.
Laurent Gomila - SFML developer

felipehenrique

  • Newbie
  • *
  • Posts: 8
    • View Profile
Using Multiple views
« Reply #2 on: January 24, 2011, 08:17:38 am »
It's because I'ma beginner and I'm not much on the subject. It has a tutorial on the website but it just work with the view of the app: S
What I not know do is to define the content of view.
If I could give me an example code as follows:
I have two sprites I want everyone to stay in one view:
sprite1 => view1
sprite2 => view2
Thank you.
(sorry for the bad tradution. is google tradutor :P)

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Using Multiple views
« Reply #3 on: January 24, 2011, 08:24:27 am »
Everything is there, you just have to translate to the .Net syntax:
http://www.sfml-dev.org/tutorials/1.6/graphics-views.php

Quote
I have two sprites I want everyone to stay in one view:
sprite1 => view1
sprite2 => view2

Code: [Select]
window.SetView(view1);
window.Draw(sprite1);

window.SetView(view2);
window.Draw(sprite2);
Laurent Gomila - SFML developer

  • Guest
Using Multiple views
« Reply #4 on: April 01, 2011, 06:59:57 am »
There's no posible to translate this to the .Net syntax, because the RenderWindow class on the .Net bindings not have some methods, in this case for example, there's no exists a method named "SetView", so... sadly... (for now, I hope...) there are a lot of things that are not capable to do with .net version.

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Using Multiple views
« Reply #5 on: April 01, 2011, 08:23:43 am »
This is exactly the same API, nothing's missing. The only difference is that a lot of Get/Set functions have been turned to properties in SFML.Net. So "SetView(v)" is just "View = v".
Laurent Gomila - SFML developer

 

anything