#String Input Problem

23 messages · Page 1 of 1 (latest)

gusty bluff
#

you can only have strings in draw_text calls, so the real() is the problem here; theres no point in doing that conversion since number is already a string

#

you want to use real() in situations you actually need the conversion for some sort of calculation AND if you're 100% sure the input from keyboard string is an actual number

#

but for draw_text, you can only have strings for drawing, no reals

viscid torrent
gusty bluff
#

so you're guaranteed its gonna try and draw a string

viscid torrent
#

draw_line_width(newX, newY, oldX, oldY, number);

gusty bluff
#

then for that you can indeed use real() since its for a calculation

#

it all depends on what type is allowed for that argument; like for draw_line_wdith that last argument needs to be a real

inland latchBOT
#

With this function you can draw a line of a specified width between any two points in the game room. Please note that the line being drawn may need different values (+/-1 on the x, y) to be drawn with the desired dimensions due to differences across the various supported platforms.

Arguments
x1: The x coordinate of the start of the line.
y1: The y coordinate of the start of the line.
x2: The x coordinate of the end of the line.
y2: The y coordinate of the end of the line.
w: The width of the line in pixels.

gusty bluff
#

but for draw_text, the last argument needs to be a string

viscid torrent
#

I was just trying to make it real in the wrong place

gusty bluff
#

yea loungin

viscid torrent
#

@gusty bluff Is there a way I can set number to say...5 before a number is put into the field?

gusty bluff
viscid torrent
#

Yes

gusty bluff
#

or do you want number to be 5 before any input? because they're two different things

viscid torrent
#

number should be five before any input I would say

gusty bluff
#

you could set keyboard_string to 5 in create event, so in the step it'll already be 5 when getting set to number

viscid torrent
#

oh cool

gusty bluff
#

so you could do:

//create
number = "";
keyboard_string = "5";