Getting Multi Line Text Input In Pygame

Поділитися
Вставка
  • Опубліковано 25 лис 2024
  • In this video I will explain how to take text input from the player in pygame.
    There are a few options available for this, but the preferred method is to use the TEXTINPUT event, which I will cover in this video.
    I'll also explain how to add backspace functionality as well as using the return key to add multiple lines of text.
    For the full source code and step by step explanation head over to my website: www.codingwithr...

КОМЕНТАРІ • 25

  • @goosewoosey2920
    @goosewoosey2920 Рік тому +10

    As a student working with python and pygame, your videos are so helpful! Please keep making these :)

  • @furiyriy
    @furiyriy 6 місяців тому +1

    the real GOAT. Super short code yet functions like crazy. Thumbs up to you man

  • @hamzaalarfaj6746
    @hamzaalarfaj6746 2 місяці тому

    From Syria. I appreciate you

  • @BrunoValle_
    @BrunoValle_ Рік тому +1

    Extremely usefull and you made it so simple, congrats, the best pygame videos are yours :)

  • @cmhrkcmn
    @cmhrkcmn Рік тому +1

    Thanks for video. Do you plan to code Zelda like game?

    • @CodingWithRuss
      @CodingWithRuss  Рік тому

      Maybe in the future! I have some ideas already in progress

  • @shaurya4ssvb816
    @shaurya4ssvb816 Рік тому +1

    hello! i was using the function for bliting the text and realised that it was printing my keys on top of what it had alreaddy printed, any help?!
    for eg
    h
    he
    hel
    hell
    hello
    it keeps overwriting on itself in the window :

    • @devpz
      @devpz Рік тому

      you have to clear the screen before drawing again

  • @thetruth45678
    @thetruth45678 Рік тому

    What exactly is the TEXTEDITING event for? The documentation is a bit vague.

  • @wamvy5151
    @wamvy5151 Рік тому +2

    Can you make a full video on infinite map generation?

    • @CodingWithRuss
      @CodingWithRuss  Рік тому +1

      That's an interesting video idea, I'll add it to the list, thanks :)

    • @Klannahar
      @Klannahar Рік тому

      What do u mean by that? is it like when u moving it auto generate map for u, or is it already stored somewhere? I guess the first one and it ment for a platformer. There are few nice video on YT about oldschool game development how did they made the games back in early 90's. It can help u a lot to optimizing ur games, cause they did use some crazy technique to make it efficient and small as possible cause they had limited memory and hdd space as well so everything had to fit in. :)
      I did love to watch them.

  • @bizuplays
    @bizuplays 8 місяців тому

    I tap w slightly and it draws like 100 ws how do I fix?

  • @andrewely413
    @andrewely413 7 місяців тому

    great tutorial

  • @Dennis.Vlachopoulos
    @Dennis.Vlachopoulos Рік тому +3

    cool video!

  • @SkyFly19853
    @SkyFly19853 Рік тому +3

    I love Python...

  • @Klannahar
    @Klannahar Рік тому +1

    Bit different aproch then how i made my GUI lib multiline texbox but it is a nice and easier way to do. Unfortunatelly i have a bunch of other functionalites what u can not achive with this method that easy.

    • @CodingWithRuss
      @CodingWithRuss  Рік тому

      As long as it works, that's the main thing :) There are often multiple ways to do this kind of stuff.

    • @Klannahar
      @Klannahar Рік тому

      @@CodingWithRuss Ye, but still pretty good way what u did show to us. Mainly my texblock is not used for user inputs, it is used for loading up dialog text from files and used in dialog window. The only 1 thing i am still thinking to add is the scroll function, what would not be hard to add, i just dont know if i wanna use that long text in general. In games users usually love to use skip button and hardly ever read texts for quests example. :D
      In your previous video about different collisions i saw something what was new to me and that was the line collision. Idk if it is new in pygame or it was there before and i just did not noticed it, but it will be handy, so i dont have to write my own function for it. :)