R
RealsLife
Guest
Hey, so i'm stuck on this for days and I think it's also because I ask the wrong questions, but let try this one more time with different questions so here I go...
1) Application surface has a height of 270px (your standard surface)
2)I make my own surface and put a list of 26sprites in it one after another with a surface height of 2000px
3)I draw the new created surface partly in the middle of the screen as a rectangle
4)The red is the new surface the green is the application surface okay now we get the scene
5)Now because the height is only 270px I made the new created surface drawn part 220px in height
6)With the slider I can slide trough the 2000px whole new created surface without problem wohooo... or so I thought
NOW comes the problem:
The step event with point_in_rectangle who checks for positions (and triggers when player can input new keyboard keys) doesn't work of course it checks for positions and values who do work but not on positions that are yet to come... I'm not sure objects or code like in the step event cares about surfaces at all but how can I solve this ugh .
I can also not change position with surface_get_width or surface_get_height and variables and stuff.
I'm stuck on this for days I've no idea what to do, I tried asking different questions on another post but I don't think I was clear about the problem? This post is about a different question so I guess i'm fine ? So welp this is an S.O.S send help please <3.
(the cool thing about drawing surfaces was that I could use the slider and see half of a text so it is a cool system)
NOW SOME CODE:
I'm only giving you the code of the input which I think you need(because it's 800lines long and I give you all the code of the object controller who makes the surface).
Now I show you the script I use for scr_rectangle_position in the code above
Now comes the object who draws the new surface and handles the new surface
1) Application surface has a height of 270px (your standard surface)
2)I make my own surface and put a list of 26sprites in it one after another with a surface height of 2000px
3)I draw the new created surface partly in the middle of the screen as a rectangle
4)The red is the new surface the green is the application surface okay now we get the scene
5)Now because the height is only 270px I made the new created surface drawn part 220px in height
6)With the slider I can slide trough the 2000px whole new created surface without problem wohooo... or so I thought
NOW comes the problem:
The step event with point_in_rectangle who checks for positions (and triggers when player can input new keyboard keys) doesn't work of course it checks for positions and values who do work but not on positions that are yet to come... I'm not sure objects or code like in the step event cares about surfaces at all but how can I solve this ugh .
I can also not change position with surface_get_width or surface_get_height and variables and stuff.
I'm stuck on this for days I've no idea what to do, I tried asking different questions on another post but I don't think I was clear about the problem? This post is about a different question so I guess i'm fine ? So welp this is an S.O.S send help please <3.
(the cool thing about drawing surfaces was that I could use the slider and see half of a text so it is a cool system)
NOW SOME CODE:
I'm only giving you the code of the input which I think you need(because it's 800lines long and I give you all the code of the object controller who makes the surface).
Code:
//STEP EVENT - INPUT OBJECT
//-------------------------------------------------------
//------------keyboard polygons check---------------------
//-------------------------------------------------------
key = scr_rectangle_position(key,1,first_line,1);
key = scr_rectangle_position(key,2,first_line,1);
key = scr_rectangle_position(key,3,first_line,1);
key = scr_rectangle_position(key,4,first_line,1);
key = scr_rectangle_position(key,5,first_line,1);
key = scr_rectangle_position(key,6,first_line,1);
key = scr_rectangle_position(key,7,first_line,1);
key = scr_rectangle_position(key,8,first_line,1);
key = scr_rectangle_position(key,9,first_line,1);
key = scr_rectangle_position(key,10,first_line,1);
key = scr_rectangle_position(key,11,first_line,1);
key = scr_rectangle_position(key,12,first_line,1);
if(key == 1){key1_description = 256;}else{previous_key1 = key1; key1_description = previous_key1; count1 = 0; }
if(key == 2){key2_description = 256;}else{previous_key2 = key2; key2_description = previous_key2; count2 = 0; }
if(key == 3){key3_description = 256;}else{previous_key3 = key3; key3_description = previous_key3; count3 = 0; }
if(key == 4){key4_description = 256;}else{previous_key4 = key4; key4_description = previous_key4; count4 = 0; }
if(key == 5){key5_description = 256;}else{previous_key5 = key5; key5_description = previous_key5; count5 = 0; }
if(key == 6){key6_description = 256;}else{previous_key6 = key6; key6_description = previous_key6; count6 = 0; }
if(key == 7){key7_description = 256;}else{previous_key7 = key7; key7_description = previous_key7; count7 = 0; }
if(key == 8){key8_description = 256;}else{previous_key8 = key8; key8_description = previous_key8; count8 = 0; }
if(key == 9){key9_description = 256;}else{previous_key9 = key9; key9_description = previous_key9; count9 = 0; }
if(key == 10){key10_description = 256;}else{previous_key10 = key10; key10_description = previous_key10; count10 = 0; }
if(key == 11){key11_description = 256;}else{previous_key11 = key11; key11_description = previous_key11; count11 = 0; }
if(key == 12){key12_description = 256;}else{previous_key12 = key12; key12_description = previous_key12; count12 = 0; }
//-------------------------------------------------------
//------------gamepad polygons check---------------------
//-------------------------------------------------------
gamep_key = scr_rectangle_position(gamep_key,1,second_line,0);
gamep_key = scr_rectangle_position(gamep_key,2,second_line,0);
gamep_key = scr_rectangle_position(gamep_key,3,second_line,0);
gamep_key = scr_rectangle_position(gamep_key,4,second_line,0);
gamep_key = scr_rectangle_position(gamep_key,5,second_line,0);
gamep_key = scr_rectangle_position(gamep_key,6,second_line,0);
gamep_key = scr_rectangle_position(gamep_key,7,second_line,0);
gamep_key = scr_rectangle_position(gamep_key,8,second_line,0);
gamep_key = scr_rectangle_position(gamep_key,9,second_line,0);
gamep_key = scr_rectangle_position(gamep_key,10,second_line,0);
gamep_key = scr_rectangle_position(gamep_key,11,second_line,0);
gamep_key = scr_rectangle_position(gamep_key,12,second_line,0);
if(gamep_key == 1){gamep1_description = 256;}else{previous_gamep1 = gamep1; gamep1_description = previous_gamep1;}
if(gamep_key == 2){gamep2_description = 256;}else{previous_gamep2 = gamep2; gamep2_description = previous_gamep2;}
if(gamep_key == 3){gamep3_description = 256;}else{previous_gamep3 = gamep3; gamep3_description = previous_gamep3;}
if(gamep_key == 4){gamep4_description = 256;}else{previous_gamep4 = gamep4; gamep4_description = previous_gamep4;}
if(gamep_key == 5){gamep5_description = 256;}else{previous_gamep5 = gamep5; gamep5_description = previous_gamep5;}
if(gamep_key == 6){gamep6_description = 256;}else{previous_gamep6 = gamep6; gamep6_description = previous_gamep6;}
if(gamep_key == 7){gamep7_description = 256;}else{previous_gamep7 = gamep7; gamep7_description = previous_gamep7;}
if(gamep_key == 8){gamep8_description = 256;}else{previous_gamep8 = gamep8; gamep8_description = previous_gamep8;}
if(gamep_key == 9){gamep9_description = 256;}else{previous_gamep9 = gamep9; gamep9_description = previous_gamep9;}
if(gamep_key == 10){gamep10_description = 256;}else{previous_gamep10 = gamep10; gamep10_description = previous_gamep10;}
if(gamep_key == 11){gamep11_description = 256;}else{previous_gamep11 = gamep11; gamep11_description = previous_gamep11;}
if(gamep_key == 12){gamep12_description = 256;}else{previous_gamep12 = gamep12; gamep12_description = previous_gamep12;}
Code:
//DRAW EVENT - INPUT OBJECT
draw_set_font(fnt_options);
draw_set_halign(fa_center);
draw_set_valign(fa_middle);
//All your buttons used being drawn
scr_input("Attack",global.asc_def[key1_description],global.asc_def[gamep1_description],1);
scr_input("Esper Attack",global.asc_def[key2_description],global.asc_def[gamep2_description],2);
scr_input("Dash",global.asc_def[key3_description],global.asc_def[gamep3_description],3);
scr_input("Walk Up",global.asc_def[key4_description],global.asc_def[gamep4_description],4);
scr_input("Walk Left",global.asc_def[key5_description],global.asc_def[gamep5_description],5);
scr_input("Walk Down",global.asc_def[key6_description],global.asc_def[gamep6_description],6);
scr_input("Walk Right",global.asc_def[key7_description],global.asc_def[gamep7_description],7);
scr_input("Open/Close Inventory",global.asc_def[key8_description],global.asc_def[gamep8_description],8);
scr_input("Open/Close Options",global.asc_def[key9_description],global.asc_def[gamep9_description],9);
scr_input("Use Item",global.asc_def[key10_description],global.asc_def[gamep10_description],10);
scr_input("Toggle Mini Menu Left",global.asc_def[key11_description],global.asc_def[gamep11_description],11);
scr_input("Toggle Mini Menu Right",global.asc_def[key12_description],global.asc_def[gamep12_description],12);
Code:
///scr_rectangle_position(key_kind,position);
key_kind = argument0;
position = argument1;
line = argument2;
switch_region = argument3;
if(mouse_check_button_pressed(mb_left) && point_in_rectangle(mouse_x,mouse_y,x_pos+line-(button_size/2),y_pos*position-(button_size/2),x_pos+line+(button_size/2),y_pos*position+(button_size/2)))
{
key_kind = position;
inside_region = switch_region;
}
return(key_kind);
Code:
//CREATE EVENT - Surface controller
surf= -1;
lengte_surf = 2000;
Code:
//DRAW EVENT - surface controller
if(surface_exists(surf))
{
view_surface_id[1] = surf;
surface_set_target(surf);
draw_sprite(spr_game_controls,0,50,10);
event_perform_object(obj_game_controls,ev_create,0);
event_perform_object(obj_game_controls,ev_step,0);
event_perform_object(obj_game_controls,ev_draw,0);
surface_reset_target();
draw_surface_part(surf, 0, 0+(obj_vbar_options_menu.real_slider_position),480,230, 0,20);
}
else
{
surf = surface_create(480,lengte_surf);
surface_set_target(surf);
draw_clear_alpha(c_black,0);
surface_reset_target();
}
Last edited by a moderator: