Hi, not the length I already have something for this.
In fact, I am making options for the game, it's a pong game and I want to choose the speed of the ball, the number of balls...
So I have options in an array :
Code:
menuText[1,6] = "Number of Balls"
menuText[1,7] = "Ball Speed"
menuText[1,8] = "Victory Points"
Some of the options can have bigger number than others (some from 1 to 8, others from 1 to 10, others from 50 to 300...). For the length I'm using this in a "press any key" event :
Code:
if (global.inputLimit > 0) && (string_length(keyboard_string) > global.inputLimit) {
keyboard_string = string_digits(keyboard_string);
keyboard_string = string_copy(keyboard_string, 1, global.inputLimit);
}
(I don't know if it's really clean but it's working with the code you write to me. If I try to modify things by myself it's not working anymore, I used this tutorial to make it because programming is not my best part :
http://site.chronic667.com/gm/tutorials/Tutorial%20-%20Input%20Box.html)
So I have many problems with this. I have an area where I can write numbers and 2 arrows, one to increment, the other to decrement but decrement from 200 to 100 takes a long time so it's better if I can directly write numbers too. The purpose is to give to the global variables the value I'm entering here.
Code:
if (menuSelected = 6) {
text = "It's time to know if fun is protportionnal to te number of balls on the screen";
global.mini = 1;
global.maxi = 9;
global.inputLimit = 1;
changeVar = global.numBalls;
}//number of balls
if (menuSelected = 7) {
text = "If you change the ball speed, think about the player speed too";
global.mini = 2;
global.maxi = 8;
global.inputLimit = 1;
changeVar = global.ballSpeed;
}
mini is the minimum value, maxi the maximum value (or should be it's nor really working for now).
global.inputLimit = 1; give the length of the string I can enter in the writing area (this one is working, alleluia !)
I hope changeVar can BECOME another variable like in AS3 and not only have his value. The purpose is with a selected part of my array (that I'm using for my menu and option menu) to give the value in the writing area to the variable I need and I know no other way to do that.
I mean, depending of which option I am selecting, I need to change global.speedBall or numberPlayers, etc. So if I enter 2, I need the variable numberPlayers to be 2, etc.
Thank you for your time, sorry for all this text.