string

  1. Michael Hart

    SOLVED 3 or 4 strings to fit in specific area

    i have strings that should fit in an area from 210 to 786 . i would like to have 3 or 4 strings to scale to fit in this area. the variables are called guest1, guest2, guest3 and guest4 all of these variables vary in string_width how can i make these fit using draw_text_transformed?
  2. T

    GameMaker Eliminar ultimo carácter de una cadena de texto/Remove the last character in a text string

    ¡¡Hola, primero que todo soy un usuario de habla hispana y mi inglés no es muy bueno!! Bueno lo que busco es como eliminar el último carácter de una cadena de texto. Llevo dos días usando Game maker 2 en su versión prueba, y me falta mucho por aprender. una agradecería de corazón su ayuda...
  3. C

    Finding the longest string in an array

    Im working on GUI right now and want to make sure the menu backdrop changes in size to fit the longest string in a given array. What function could I use to accomplish this? (I'm using GMS:S 1.4)
  4. Z

    SOLVED weird string error

    i get this error when i try to run the project and i cant see why is it happening
  5. K

    change multiple variables value in a for loop

    hello everyone. i'm new to coding in general and i was wondering if you can help me with this problem: i have this variables global.StatLvl1 = 2 global.StatLvl2 = 2 global.StatLvl3 = 2 global.StatLvl4 = 2 global.StatLvl5 = 2 global.StatLvl6 = 2 global.StatLvl7 = 2 global.StatLvl8 = 2...
  6. sv3nxd

    GML Most efficient way to render a textbox

    Hey, I'm currently working on an open-source project in which you can create a textbox with one single command. I've been working on it for a long time now, trying to improve it in every way I could. (https://github.com/Sven98/ezBox) I was wondering if the way I am doing it right now is...
  7. T

    Remove last character from a string

    I'm really struggling with setting typing limitations right now. Ideally I'd like to have it so that once the player's keyboard_string exceeds a width of 248 pixels, they can't type anything else to add to the string until some characters have been removed. I couldn't figure out how to stop...
  8. Pompadour Dude

    GameMaker (SOLVED) How to combine string variables?

    Hey guys, I am working on one of my games and I want characters to change clothing (head / body / legs) separately. I want to use three string variables. For example: headSlot = "some var" bodySlot = "some var" legsSlot = "some var" These variables can be equal to clothing type: bodySlot =...
  9. jobjorgos

    GML how to play a sound from string name

    snd_string = 'snd_szymat_echo_party' audio_play_sound(snd_string,10,true); Why does the above code not work? Do I have to convert the string to something else first?
  10. C

    GameMaker [Solved] Programmatically number sprites

    I'm working on a math learning game that uses tiles for the potential answers as well as the questions. The range of the answers is 0-19, so it was easy to make a single sprite that had all of the numbers on different frames. Then to use the image_index to set the number and store which number...
  11. C

    GML [Solved] Zero Padding a number as a string

    I'm creating a clock for my game and I'm having issues with zero padding the numbers. I could use if statements and I will if necessary, but that's ugly code. In python I'd simply use: '{:02d}:{:02d}'.format(minutes, seconds) My output would be: 01:24 or 03:07 or 12:05 The point is to add the...
  12. G

    GameMaker Empty Boxes at newline locations after converting a txt file to string

    Hi everybody. I'm stumped on this one. I've been messing around with it for about an hour now, and I just can't figure out what this character is that keeps appearing at the end of a line after converting a txt file of dialogue to a string to use inside the game. I wrote this function to return...
  13. G

    GameMaker [SOLVED] - string_lettersdigits_ext(str, [inclusions], [exclusions])

    Here's another script that goes along with string_letters() family. This string works much like non-alphanumeric script except that it works in the other direction: obtains the letters and digits opposed to non-alphanumeric chars. Again, you can add inclusions and exclusions based on which...
  14. G

    GameMaker [SOLVED] - string_nonalphanumeric(str, [inclusions], [exclusions]);

    Here's an interesting script you can use. I call it string_nonalphanumeric(). It goes with string_letters(), string_digits(), and string_lettersdigits(). It accepts an input string and parses out the non-alphanumeric characters. You can also include specific alphanumeric characters to return...
  15. Daniel Mallett

    GameMaker text border issues

    x = 500; y = 500; string_val = "string"; draw_text(x, y, string_val); width = string_width(string_val); height = string_height(string_val); draw_rectangle(x, y, x + width, y + height, 1); I am trying to implement a dialogue with form controls, text, etc. I have been having problems...
  16. Michael Stearns

    GML Solved - String Width but ignoring line breaks

    Hello! I've got a text box that gradually fills with text, typewriter-style. I wanted to draw a little "cursor" at the end of the string being displayed, but I seem to be having some trouble. The problem is that string_width (and string_width_ext) does not seem to actually return the line...
  17. M

    GameMaker Execute script with variable

    Hello everyone! I have a small problem in my mobile project. I created a button that should lead to the next level. All the level atributes are saved in scripts: scr_level1 , scr_level2 , scr_level 3 and so on. So in the button I added these lines: // this button is in rm_game //when button is...
  18. W

    Mac OSX [SOLVED] String Literal Issues: Missing Glyph at Line Breaks

    I'm going through the Space Rocks tutorial and I've run into an issue with line breaks in literal strings. I'm creating the start up menu text using: @" score 1,000 points to win! UP: move ...etc." However, upon running the game, at the beginning of each new line theres the missing glyph...
  19. E

    GML How to Solve this String Wrap Problem?

    Hello, everyone. I'm having a quite silly problem; I'll start from the beginning. I made a drawing text script that gets the tags from string and then converts these tags into new drawing functions. Having this I can't string warp the string regarding the width of it, because it will check not...
  20. N

    GameMaker [Solved]Storing keyboard_string in two variables with different length

    I'm having trouble wrapping my brain around strings, and especially how string_delete works. I'm trying to store characters from keyboard_string in two different variables with different lenghts. One of the variables is used to store only 1 character (output), which refreshes everytime...
Top