Hello, trying to print a text i input

Questions about the LÖVE API, installing LÖVE and other support related questions go here.
Forum rules
Before you make a thread asking for help, read this.
MysticPing2
Prole
Posts: 33
Joined: Tue Dec 10, 2013 7:08 pm

Hello, trying to print a text i input

Post by MysticPing2 »

So ive been lurking around trying to get this work, while posting this i realised my code to check where the mouse is would break the code, but i tried without it. This is basicly a WIP on a box you click on and then you write, you can see what you write and i will use the writing for some calculations.
What happens is that nothing happens.

My other problem is that conf.lua gets completely ignored by love.exe
Attachments
Tax.love
(1007 Bytes) Downloaded 150 times
User avatar
veethree
Inner party member
Posts: 877
Joined: Sat Dec 10, 2011 7:18 pm

Re: Hello, trying to print a text i input

Post by veethree »

I was going to modify your code to work, But no offence, Your code is really messy. Cant really blame you as you're a beginner. Either way, I decided to just give you a working example. There's plenty of comments in it explaining the code. If you have any questions regarding it, Fire at will.

Also, Your .love is packaged incorrectly, The main.lua file should be in the root of the zip file. And the reason why conf.lua was "being ignored" seems to be because you're using version 0.8.0 of love, but 0.9.0 code. My example is written for 0.8.0, And wont work in 0.9.0 because of the way i'm handling the text input. Implementing this in 0.9.0 however should be easier thanks to the love.textinput function.

In the example, You have to click on the textbox to type into it
Attachments
textbox.love
(1.04 KiB) Downloaded 154 times
MysticPing2
Prole
Posts: 33
Joined: Tue Dec 10, 2013 7:08 pm

Re: Hello, trying to print a text i input

Post by MysticPing2 »

thankyou, and also i downloaded the latest version from the site, so i assumed it was 9.0. Ill try what you sent, thank you again!
User avatar
veethree
Inner party member
Posts: 877
Joined: Sat Dec 10, 2011 7:18 pm

Re: Hello, trying to print a text i input

Post by veethree »

MysticPing2 wrote:thankyou, and also i downloaded the latest version from the site, so i assumed it was 9.0. Ill try what you sent, thank you again!
0.9.0 hasn't been officially released yet, the version on the homepage is 0.8.0.

0.9.0 should however be released very soon. So you may as well start using nightly builds and learn the 0.9.0 syntax.
MysticPing2
Prole
Posts: 33
Joined: Tue Dec 10, 2013 7:08 pm

Re: Hello, trying to print a text i input

Post by MysticPing2 »

thanks again :) Although i think a more stable 8.0 will do for now since i dont want to rage more xD
MysticPing2
Prole
Posts: 33
Joined: Tue Dec 10, 2013 7:08 pm

Re: Hello, trying to print a text i input

Post by MysticPing2 »

within your text_box you have a y and a x, i noticed you refeered to textbox.y and textbox.x so that is a doable thing? Ok. Im starting to get your code now :) I have much to learn xD
MysticPing2
Prole
Posts: 33
Joined: Tue Dec 10, 2013 7:08 pm

Re: Hello, trying to print a text i input

Post by MysticPing2 »

Also if i needed to have more boxes, would i just do the same but with different names?
also conf.lua most still be ignored beacuse t.console=true doesnt do anything
bekey
Party member
Posts: 255
Joined: Tue Sep 03, 2013 6:27 pm

[]

Post by bekey »

-snip-
Last edited by bekey on Fri Jan 24, 2014 2:17 am, edited 1 time in total.
User avatar
veethree
Inner party member
Posts: 877
Joined: Sat Dec 10, 2011 7:18 pm

Re: Hello, trying to print a text i input

Post by veethree »

MysticPing2 wrote:Also if i needed to have more boxes, would i just do the same but with different names?
also conf.lua most still be ignored beacuse t.console=true doesnt do anything
Yes you can do that, That may not be an ideal way to do it, But if you're only dealing with a couple textboxes, That should do fine.

I commented out the t.console line in the conf file, If you've uncommeted the line, Then what OS are you on? The console is a windows only feature. You can get the same console functionality on linux if you run the game from a console, Not sure about how that works on os x.
MysticPing2
Prole
Posts: 33
Joined: Tue Dec 10, 2013 7:08 pm

Re: Hello, trying to print a text i input

Post by MysticPing2 »

Also, since im only using this for a simple tax calculator for a forum, is it OK if i use and alter your code (and distribute it, ofcorse i wont earn money on it :P)

I learn alot from reading it



-- I keep pressing save instead of submit
Post Reply

Who is online

Users browsing this forum: Google [Bot] and 1 guest