Search found 22 matches

by RaycatRakittra
Tue Jun 13, 2017 7:36 pm
Forum: General
Topic: Drawing UI Bits: composition or direct paint?
Replies: 7
Views: 2100

Re: Drawing UI Bits: composition or direct paint?

[...] I was wondering why the tutorial on Canvases in the wiki would set the canvas in the love.load? And is this performance related? Thanks. I'd imagine they were setting up the Canvas's initial state. You don't want to constantly reset your Canvas in something like love.update() or love.draw(). ...
by RaycatRakittra
Tue Jun 13, 2017 2:45 pm
Forum: Support and Development
Topic: Number displays incorrectly if the first digit is zero
Replies: 12
Views: 2738

Re: Number displays incorrectly if the first digit is zero

@zorg: I'm not ignoring you. I legitimately didn't even see you post on this whole thread until today.
And you've proved your point; yes, your code works. OP should use your code.
by RaycatRakittra
Mon Jun 12, 2017 5:42 pm
Forum: Support and Development
Topic: Number displays incorrectly if the first digit is zero
Replies: 12
Views: 2738

Re: Number displays incorrectly if the first digit is zero

Keep in mind, I want the number to display as (XXX) XXX-XXXX, not XXXXXXXXXX You already have the code to print it properly. This is my code: [...] text = "("..new:sub(1,3)..") "..new:sub(4,6).."-"..new:sub(7,10) [...] Just replace 'new' with the tostring(). phoneNumber = tostring(text) printedText...
by RaycatRakittra
Mon Jun 12, 2017 1:51 pm
Forum: Support and Development
Topic: Number displays incorrectly if the first digit is zero
Replies: 12
Views: 2738

Re: Number displays incorrectly if the first digit is zero

That sounds like a case of insignificant digits.
Zeroes that precede a number are irrelevant because 00003 is still 3.
You need to ensure the text you're printing is a string, not a number.
Just wrap it in tostring() like so:

Code: Select all

function love.draw()
	love.graphics.print(tostring(text), 0, 15)
end
by RaycatRakittra
Thu Jun 08, 2017 4:19 pm
Forum: General
Topic: Drawing UI Bits: composition or direct paint?
Replies: 7
Views: 2100

Re: Drawing UI Bits: composition or direct paint?

[...] If you don't mind though, I would like to ask a question. Why use Canvas, does the use of Canvases have any hit to performance (increase or decrease), and would this give you more control in drawing stuff? It's just an off-screen render target but yeah, it has more control in regards to overa...
by RaycatRakittra
Tue Jun 06, 2017 8:10 pm
Forum: General
Topic: Is there any library which makes love more like Phaser?
Replies: 2
Views: 1320

Re: Is there any library which makes love more like Phaser?

Hi. Welcome to the forums. To clarify: LOVE is a framework, not an engine. It provides the functions needed to do things and doesn't really hold your hand. That attracts a certain group of people but it might not be your speed. To answer your question, I believe there was a library called Zoetrope t...
by RaycatRakittra
Wed May 31, 2017 7:43 pm
Forum: General
Topic: Drawing UI Bits: composition or direct paint?
Replies: 7
Views: 2100

Drawing UI Bits: composition or direct paint?

(Still at work so, I can't really jump into the code.) I was kicking some ideas around in my head and the topic of UI came up. What do you guys do to draw it on the screen? Some people paint it directly inside of love.draw() but does anyone draw to a Canvas like a compositor? So, instead of: functio...
by RaycatRakittra
Wed May 31, 2017 3:55 pm
Forum: Support and Development
Topic: Question about LuaJIT and FFI
Replies: 7
Views: 2866

Re: Question about LuaJIT and FFI

I am not an expert on the subject but this is my takeaway from LuaJIT, FFI, and company: 1) LuaJIT is a just-in-time compiler that only works with Lua 5.1. It makes LOVE two to four times faster at the cost of never upgrading to Lua 5.2+. Does that matter to you? Probs not; Lua is weird that way. Ho...
by RaycatRakittra
Fri May 12, 2017 1:12 pm
Forum: General
Topic: Character movement with love.physics ?
Replies: 3
Views: 1738

Re: Character movement with love.physics ?

I'd just like to add: if you're using this for a physics-based game, go ahead. Otherwise, love.physics might be too much. Consider x, y, dx, dy and modify the speed you move at, instead. I'd imagine something like: function love.update() -- Check for inputs if love.keyboard.isDown('<left>') dx = dx ...
by RaycatRakittra
Fri May 05, 2017 12:55 pm
Forum: Support and Development
Topic: [SOLVED]How to implement new levels correctly
Replies: 5
Views: 1503

Re: How to implement new levels correctly

[...] However, if my character then should go to a new level with new graphics, music etc., how do I can start anew? [...] Also, should I release memory etc. from previous level resources? Is there a recommended structure or tutorial for this...? It's your game. You decide what 'structure' you want...