x = (room_height*view_xview)/35 y = (room_height*view_yview)/35How can I fix this?
View screen at middle.
#1
Posted 15 February 2012 - 03:08 AM
#2
Posted 15 February 2012 - 03:26 AM
This takes the current object, moves it to the heoght of the room multiplied by the upperleft corner of the view, then divides it by 35.
if you just want to move the view to the middle of the room, just do
view_xview[0] = room_width/2 - view_wview[0]/2
view_yview[0] = room_height/2 - view_hview[0]/2
Edited by greep, 15 February 2012 - 03:27 AM.
#3
Posted 15 February 2012 - 11:13 PM
I don't want to view it on the middle of the room! When paused object appears, I want to draw the text to the middle of the view of the main object. Any ides?Hrm, could you clarify what you want to do?
This takes the current object, moves it to the heoght of the room multiplied by the upperleft corner of the view, then divides it by 35.
if you just want to move the view to the middle of the room, just do
view_xview[0] = room_width/2 - view_wview[0]/2
view_yview[0] = room_height/2 - view_hview[0]/2
#4
Posted 15 February 2012 - 11:20 PM
How about:
x = view_xview[0] + view_wview[0]/2 ;
y = view_yview[0] + view_hview[0]/2 ;
edit: Although if the view just follows the object, just to x = yourobject.x; y = yourobject.y. Also sorry for getting annoyed, it's just sometimes newbies think helpers can read minds
Edited by greep, 16 February 2012 - 12:49 AM.
#5
Posted 16 February 2012 - 02:08 PM
execute code:
x = (view_xview[0]/2 + view_wview[0]/2)-130
y = (view_yview[0]/2 + view_hview[0]/2)+120
Destroy Event:
Unknown Action
Draw Event:
execute code:
for (l=1; l <= pauseText[pausePage,0]; l+=1)
{
if (pauseSelected = l)
{
draw_set_color(c_red)
}
else
{
draw_set_color(c_black)
}
draw_text(x,y+(l*16)-16,pauseText[pausePage,l]);
}
if pausePage = 2
{
draw_text(obj_pause.x-15,obj_pause.y-45,"Are you sure you want to the Main Menu?")
}
if pausePage = 0
{
draw_text(obj_pause.x+5,obj_pause.y-25,"Paused!")
}
It draw the whole text not in the the player's position but in terms of the room. How can I fix this?
#6
Posted 16 February 2012 - 09:49 PM
x = YourPlayerObject.x
y = YourPlayerObject.y
put it in the end step so it doesn't ;ag behind the player.
Edited by greep, 16 February 2012 - 09:49 PM.
#7
Posted 17 February 2012 - 12:23 PM
Bah you said to "the middle of the view of the main object". If you just want the players position do
x = YourPlayerObject.x
y = YourPlayerObject.y
put it in the end step so it doesn't ;ag behind the player.
___________________________________________
ERROR in
action number 1
of End Step Event
for object obj_pause:
Error in code at line 1:
x = GrayCircle.x
^
at position 16: Unknown variable x
Information about object: GrayCircle //player object Create Event: execute code: x = x y = yWhat's wrong?
#8
Posted 17 February 2012 - 12:47 PM
A) Graycircle might be the name of your sprite or something as well as your object. Duplicate names are a nono
C) The main character is killed or maybe deactivated during a pause
D) Misspelled your own object
try
if (instance_exists(GrayCircle))
{
x = GrayCircle.x
y = GrayCircle.y
}
Edited by greep, 17 February 2012 - 12:50 PM.
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users











