Search found 39 matches

by YounYokel
Thu Oct 10, 2019 4:36 pm
Forum: Support and Development
Topic: [SOLVED] How do I import files from specific folder in the game directory?
Replies: 5
Views: 4675

Re: How do I import files from specific folder in the game directory?

pgimeno wrote: Wed Oct 09, 2019 6:23 pm Use / instead of \
Oops. That was silly :P
by YounYokel
Wed Oct 09, 2019 3:45 pm
Forum: Support and Development
Topic: [SOLVED] How do I import files from specific folder in the game directory?
Replies: 5
Views: 4675

[SOLVED] How do I import files from specific folder in the game directory?

Hello! It's quite weird for me, but when I'm setting the new font but I cannot import the font from a folder, I need to type the name only. If that file doesn't exists in the project folder, game will crash. local myFont = love.graphics.newFont( "fonts\opensans.ttf", 14 ) What should I do ...
by YounYokel
Sun Oct 06, 2019 1:59 pm
Forum: Libraries and Tools
Topic: [Notepad++] Launch Project From Any File
Replies: 3
Views: 14001

Re: [Notepad++] Launch Project From Any File

Very good. One thing you can add in "Execute" option is this at the begging:

Code: Select all

NPP_SAVE
It will save the project.
by YounYokel
Sun Oct 06, 2019 12:12 pm
Forum: Support and Development
Topic: [SOLVED] How to get the string length?
Replies: 5
Views: 4776

Re: How to get the string length?

MrFariator wrote: Sun Oct 06, 2019 11:25 am Any of these methods work.

Code: Select all

-- all print 4
local str = "asdf"
print(#str)
print(string.len(str))
print(str:len())
This page lists the available string methods.
Thank you! Didn't know about the hashtag.
by YounYokel
Sun Oct 06, 2019 11:21 am
Forum: Support and Development
Topic: [SOLVED] How to make a linebreak?
Replies: 6
Views: 4612

Re: How to make a linebreak?

local myText = [[this is where my text goes and it will handle linebreaks]] function love.draw () love.graphics.print(myText, 10, 10) end One thing to keep in mind is that all contents between [[]] will be caught, so it will also take the indentation into account if present. Example: function love....
by YounYokel
Sun Oct 06, 2019 11:19 am
Forum: Support and Development
Topic: [SOLVED] How to get the string length?
Replies: 5
Views: 4776

[SOLVED] How to get the string length?

Hey, is there a way to get a string length?
Like this:

Code: Select all

local textStr = "Hello World"
local textLen = textStr:getLength

function love.draw( dt )
    love.graphics.print( tostring( textLen ) ) -- Returns 11
end
by YounYokel
Sun Oct 06, 2019 11:00 am
Forum: Support and Development
Topic: [SOLVED] How to make a linebreak?
Replies: 6
Views: 4612

Re: How to make a linebreak?

ivan wrote: Sun Oct 06, 2019 4:30 am Also, you can use real line breaks with the [[ ]] operator.
Really? And how to use them? Post an example please.
by YounYokel
Sun Oct 06, 2019 10:57 am
Forum: Support and Development
Topic: [SOLVED] How to make a linebreak?
Replies: 6
Views: 4612

Re: How to make a linebreak?

pgimeno wrote: Sat Oct 05, 2019 8:52 pm What's wrong with

Code: Select all

"\n"
itself?

This works for me:

Code: Select all

function love.draw(dt)
    love.graphics.print( "First of all:\n  1. Blah Blah Blah\n  2. Blah Blah Blah" )
end
WHAT !? I really had no idea because I'm new at LUA

Well, I guess topic is solved =P
by YounYokel
Sat Oct 05, 2019 3:06 pm
Forum: Support and Development
Topic: [SOLVED] How to make a linebreak?
Replies: 6
Views: 4612

[SOLVED] How to make a linebreak?

Hey guys, do you know a way to create a linebreak like in C++ ( "\n" or std:endl ) for example? function love.draw(dt) love.graphics.print( "First of all: " .. endline .. " 1. Blah Blah Blah" .. endline .. " 2. Blah Blah Blah" ) end This would be much easier f...