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

Author Topic: Scrolling Background  (Read 7702 times)

0 Members and 1 Guest are viewing this topic.

haxortiz

  • Newbie
  • *
  • Posts: 14
    • View Profile
Scrolling Background
« Reply #15 on: March 10, 2010, 05:41:50 pm »
Quote from: "model76"
Well, how about comparing the view's position to the position and size of the background sprite? Remember to account for the view's size, as well, if you need that.


How can I get the position of the view? since getPosition isn't in View Class.

G.

  • Hero Member
  • *****
  • Posts: 1593
    • View Profile
Scrolling Background
« Reply #16 on: March 10, 2010, 09:29:18 pm »
There may not be GetPosition(), but GetRect(), GetCenter() and GetHalfSize() exist.

haxortiz

  • Newbie
  • *
  • Posts: 14
    • View Profile
checking view
« Reply #17 on: March 12, 2010, 11:51:49 pm »
How can i check the right of the view, i'm using the getcenter but that only gets the center well i want it before, before the user even sees the background. How could i do this?

Thanks,

Haxortiz

model76

  • Full Member
  • ***
  • Posts: 231
    • View Profile
Re: checking view
« Reply #18 on: March 13, 2010, 03:02:03 am »
Quote from: "haxortiz"
How can i check the right of the view, i'm using the getcenter but that only gets the center well i want it before, before the user even sees the background. How could i do this?
I don't know what you mean, sorry. GetCenter() has nothing to do with when the user sees the "background". The user will only see things after you draw them, and you can use GetCenter() pretty much anywhere in your code...

If you mean that you want to know the edge of the view, you can use GetRect() or GetCenter() and GetHalfSize(). Otherwise, you will have to be more clear, and maybe post some code, and try to explain exactly how you want it to work, and what your code does wrong.

 

anything