Oops. That was silly
Search found 39 matches
- 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
- 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 ...
- 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:
It will save the project.
Code: Select all
NPP_SAVE
- 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?
Thank you! Didn't know about the hashtag.MrFariator wrote: ↑Sun Oct 06, 2019 11:25 am Any of these methods work.This page lists the available string methods.Code: Select all
-- all print 4 local str = "asdf" print(#str) print(string.len(str)) print(str:len())
- 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....
- 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:
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
- Sun Oct 06, 2019 11:00 am
- Forum: Support and Development
- Topic: [SOLVED] How to make a linebreak?
- Replies: 6
- Views: 4612
- 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?
WHAT !? I really had no idea because I'm new at LUApgimeno wrote: ↑Sat Oct 05, 2019 8:52 pm What's wrong withitself?Code: Select all
"\n"
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
Well, I guess topic is solved =P
- 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...