move pad iphone like
#1
Posted 14 March 2012 - 11:56 AM
#2
Posted 14 March 2012 - 12:14 PM
I can tell you are not from here. Do you mean something like a 3DS Analog that slides around like this?(on the very left or very right):Anyone know how to do this? I have do some test to make a toucheble move pad for ihone/android games but not work properly. Anyone have do it or have link to a working example?

Or touch controls like this:

Or like this maybe?:
#3
Posted 14 March 2012 - 01:13 PM
#4
Posted 14 March 2012 - 01:25 PM
Oh okay. So for touch controls like one button in the lower left corner for moving left, one next to that for right and then the one at the far end of it for the up key? if your room was default 640x480 you would just have an object in every room that has this in its create event:i mean touch controls
YoYo_AddVirtualKey(0,480-128,128,128,vk_left) YoYo_AddVirtualKey(128+16,480-128,128,128,vk_right YoYo_AddVirtualKey(640-128,480-128,128,128,vk_up)And then if you wanted to show them so you can see them you could make seperate objects with these codes for each of them and then assign them the button sprite that has to be 128 by 128
left button object step event:
YoYo_AddVirtualKey(x,y,128,128,vk_left) x=view_xview[0] y=view_yview[0]+480-128right button object step event:
YoYo_AddVirtualKey(x,y,128,128,vk_right) x=view_xview[0]+128+16 y=view_yview[0]+480-128and jump button step event(you have to have jump assigned to the up button):
YoYo_AddVirtualKey(x,y,128,128,vk_up) x=view_xview[0]+640-128 y=view_yview[0]+480-128
SO! This is all assuming that you only need basic platform movement and jumping codes and that your room size is default. You can change the values depending on the room sizes and all that and the buttons you want it to be. If you dont have a view you can just get rid of the view_xview and view_yview and then you can change the values. 640 represents the room width and 480 represents the room height so you can change them accordingly. 128 is the size of the button. this will put the left and right buttons 16 pixels apart from eachother aswell.
#5
Posted 15 March 2012 - 12:14 AM
Oh okay. So for touch controls like one button in the lower left corner for moving left, one next to that for right and then the one at the far end of it for the up key? if your room was default 640x480 you would just have an object in every room that has this in its create event:
i mean touch controlsYoYo_AddVirtualKey(0,480-128,128,128,vk_left) YoYo_AddVirtualKey(128+16,480-128,128,128,vk_right YoYo_AddVirtualKey(640-128,480-128,128,128,vk_up)And then if you wanted to show them so you can see them you could make seperate objects with these codes for each of them and then assign them the button sprite that has to be 128 by 128
left button object step event:YoYo_AddVirtualKey(x,y,128,128,vk_left) x=view_xview[0] y=view_yview[0]+480-128right button object step event:YoYo_AddVirtualKey(x,y,128,128,vk_right) x=view_xview[0]+128+16 y=view_yview[0]+480-128and jump button step event(you have to have jump assigned to the up button):YoYo_AddVirtualKey(x,y,128,128,vk_up) x=view_xview[0]+640-128 y=view_yview[0]+480-128
SO! This is all assuming that you only need basic platform movement and jumping codes and that your room size is default. You can change the values depending on the room sizes and all that and the buttons you want it to be. If you dont have a view you can just get rid of the view_xview and view_yview and then you can change the values. 640 represents the room width and 480 represents the room height so you can change them accordingly. 128 is the size of the button. this will put the left and right buttons 16 pixels apart from eachother aswell.
thanks so much.
#6
Posted 15 March 2012 - 06:57 AM
#7
Posted 15 March 2012 - 12:03 PM
No idea. My guess is it might have something to do with something like a dragging(obviously) And then in the mouse clicking event it first checks if the point_distance(x,y,(however much you want to be able to slide it out),(once again)) Is true and if it is then dont move it anymore but then the problem with that is that it wont be able to move around at all which isnt what anybody wants. This is something that has stumped me alot because i have also tried to make a rope using point_distance but theres once again still the problem of the movement. Its the same concept though, so maybe you can find something on the gmc.Any ideas how to implement onscreen analog stick?
#8
Posted 15 March 2012 - 12:20 PM
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users











