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

Author Topic: View problems  (Read 9979 times)

0 Members and 3 Guests are viewing this topic.

Yelnats

  • Newbie
  • *
  • Posts: 27
    • View Profile
View problems
« Reply #15 on: April 12, 2011, 05:14:05 am »
I've done this
Code: [Select]
else if (y > yscreensize - View.GetSize().y / 2  + 80)
sety = yscreensize - View.GetSize().y / 2 + 80;
but now when the sprite is going down, the view only begins going down when the y point is at 240, not 200. So instead of camera moving at 200, it moves at 240. And I don't mean the top of the sprite either, I mean the 20 pixels down point(due to the offset I set). Another thing is that the camera follows it until there is a 95 pixel gap, not an 80 pixel gap. Here is a picture to illustrate what I mean.

The 2 lines represent the center point of the view, the meeting point being 320,200.

Wizzard

  • Full Member
  • ***
  • Posts: 213
    • View Profile
View problems
« Reply #16 on: April 12, 2011, 07:15:34 am »
If you're still having problems, you need to post compilable, but minimal, code that demonstrates what you're trying to do and fails to do with comments that explain what your goal is.
All the code that you have posted doesn't demonstrate a problem. I can't help you if you don't post compilable code where you tried to achieve a result and it failed.

I'm just not that good. ;)

Fred_FS

  • Newbie
  • *
  • Posts: 48
    • View Profile
View problems
« Reply #17 on: April 12, 2011, 01:29:20 pm »
I don't know, what your problem is. I have just tested your application and it worked exactly as I would wish it to.
With this formula you should have some space of 80px below your "moving-area"
Code: [Select]
else if (y > yscreensize - View.GetSize().y / 2  + 80)
   sety = yscreensize - View.GetSize().y / 2 + 80;


For testing I added a sprite(height: 80px) at the bottom of the moving area. This is, what it looks like:


So what exactly is the problem?

Yelnats

  • Newbie
  • *
  • Posts: 27
    • View Profile
View problems
« Reply #18 on: April 12, 2011, 09:57:30 pm »
That exactly is my problem the green area is 95 pixels high, instead of 80. Measure it yourself if you must. The idea is that it stops moving at 80 pixels, instead of 95.

Fred_FS

  • Newbie
  • *
  • Posts: 48
    • View Profile
View problems
« Reply #19 on: April 13, 2011, 01:14:43 am »
For that reason I created this green sprite. It is exactly 80 pixels high. And so this gap is not 95 pixels but really 80 pixels high.
It seems to be 95 pixels, but this may be caused(I don't know it for sure) by the view-size. The view-size has not the same ratio as the window size and so all objects will be streched.

Yelnats

  • Newbie
  • *
  • Posts: 27
    • View Profile
View problems
« Reply #20 on: April 13, 2011, 04:13:46 am »
Yes thanks! I get it now! I set the viewport to be 0,0,1,0.8333. Thanks man!

 

anything