Jump to content


Photo

[SOLVED] Object moving with view?


  • Please log in to reply
4 replies to this topic

#1 ElevenYears

ElevenYears

    GMC Member

  • New Member
  • 45 posts
  • Version:GM:HTML5

Posted 02 January 2012 - 06:42 AM

I don't usually create games, I usually create programs, so now that I'm done making an excuse for my noobyness, here's the question:
How do I make an object move with the view?
Thanks for viewing and helping. :P
Have a heck of a day!

Edited by ElevenYears, 04 January 2012 - 12:11 AM.

  • 0

#2 _245832

_245832

    GMC Member

  • New Member
  • 18 posts

Posted 02 January 2012 - 06:47 AM

On room properties, go to views, select enable the use of views, visible when game starts, and your object, finally change HBor, VBor to half of the width of your room, and Hsp and Bsp to half of the height.
  • 0

#3 ElevenYears

ElevenYears

    GMC Member

  • New Member
  • 45 posts
  • Version:GM:HTML5

Posted 02 January 2012 - 06:53 AM

I have the object that has the screen fallowing, I have five more objects that I need to fallow with the screen - Top and bottom.
  • 0

#4 ElevenYears

ElevenYears

    GMC Member

  • New Member
  • 45 posts
  • Version:GM:HTML5

Posted 03 January 2012 - 04:01 AM

Bump - Need help with objects staying in screen with it moving.
Object fallowing screen/user, not screen fallowing object!
  • 0

#5 Silvess

Silvess

    GMC Member

  • GMC Member
  • 497 posts
  • Version:GM8

Posted 03 January 2012 - 04:10 AM

Bump - Need help with objects staying in screen with it moving.
Object fallowing screen/user, not screen fallowing object!


in the objects Step Event:

x=x+view_xview
y=y+view_yview

Might want to draw the object as well using the views in x and y to prevent a jitter while you're
at it.

in the objects Draw Event:

draw_sprite(sprite_index,image_index,x+view_xview,y+view_yview)

Edited by Silvess, 03 January 2012 - 04:15 AM.

  • 0




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users