Author Topic: Axe TextBox input?  (Read 2800 times)

0 Members and 1 Guest are viewing this topic.

Offline thydowulays

  • LV4 Regular (Next: 200)
  • ****
  • Posts: 184
  • Rating: +12/-1
  • Don't gimme dat lip
    • View Profile
    • Thy Gaming Forum
Axe TextBox input?
« on: December 24, 2011, 12:56:21 pm »
Hey omnimaga, I am working on a GUI library atm, and I want to add a TextBox feature to it. This would be very useful because people could use this feature for their programs, and the Axe input function isn't exactly perfect. So I want to make it a little like the DoorsCS Text input. I already know sort of how to do it. The command to draw the TextBox would be DRTXT(Xpos,Ypos,Width,Enabledornot) I would have a gray line at Xpos+1, so it would be the cursor, like in DoorsCS's TextBox. So anyway, I would use a variable that would represent where the cursor would be (it would start at Xpos+1). Now everytime someone would press an alphabet key, the variable would go up 4 pixels, and the cursor would move. Then I would use a Text(CursorVariable, Ypos+1, "whateveralphabetkeyletteritsassignedto") at that position. When all this works out, I would have a working textbox that people could type in. However, does anyone know how I could make a string out of their text? I can't figure it out at all. Thanks :)
Current Projects:
-Sparta GUI Library: 25% - Alpha Stage
-Grapher - 75% - Beta Stage *on hiatus




Offline saintrunner

  • Custom Spriter: You ask it! I'll Make it!
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1787
  • Rating: +115/-11
  • Flogging Molly
    • View Profile
    • Jonny K Music
Re: Axe TextBox input?
« Reply #1 on: December 24, 2011, 01:45:40 pm »
->str1 ??
My Sprites Thread   :Updated often :) for your viewing pleasure

GAMES:

Offline epic7

  • Chopin!
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2200
  • Rating: +135/-8
  • I like robots
    • View Profile
Re: Axe TextBox input?
« Reply #2 on: December 24, 2011, 01:55:25 pm »
Do you want to know how to input text in an axe program?

If so, try this routine
« Last Edit: December 24, 2011, 01:57:28 pm by epic7 »

Offline LincolnB

  • Check It Out Now
  • LV9 Veteran (Next: 1337)
  • *********
  • Posts: 1115
  • Rating: +125/-4
  • By Hackers For Hackers
    • View Profile
Re: Axe TextBox input?
« Reply #3 on: December 24, 2011, 03:18:52 pm »
Hm, I wrote an input routine, once... you called the routine like so - Input(r1,r2,r3) where r1,r2 was the X,Y coordinate of where the routine was to be located, and r3 was a flag - 1 meant it was a text input, and 0 meant it was a numeric input. It returned a pointer to the string, or the number that was inputted.
Completed Projects:
   >> Spacky Emprise   >> Spacky 2 - Beta   >> Fantastic Sam
   >> An Exercise In Futility   >> GeoCore

My Current Projects:

Projects in Development:
In Medias Res - Contest Entry

Talk to me if you need help with Axe coding.


Spoiler For Bragging Rights:
Not much yet, hopefully this section will grow soon with time (and more contests)



Offline thydowulays

  • LV4 Regular (Next: 200)
  • ****
  • Posts: 184
  • Rating: +12/-1
  • Don't gimme dat lip
    • View Profile
    • Thy Gaming Forum
Re: Axe TextBox input?
« Reply #4 on: December 24, 2011, 11:27:31 pm »
Thank you so much, ily. No homo.
Current Projects:
-Sparta GUI Library: 25% - Alpha Stage
-Grapher - 75% - Beta Stage *on hiatus