Search found 3087 matches

by zorg
Sat Oct 11, 2014 1:41 pm
Forum: Support and Development
Topic: Loading File by Game State
Replies: 5
Views: 1903

Re: Loading File by Game State

I use hump gamestates actively, and with that, one can have three additional "callbacks" besides hooking love's callbacks to states; state:init, state:enter and state:leave. You probably want to use the middle and last functions to load and discard images when entering/leaving a specific s...
by zorg
Thu Oct 09, 2014 11:58 am
Forum: General
Topic: What's your favorite type of 2D game?
Replies: 12
Views: 3361

Re: What's your favorite type of 2D game?

I personally like many games in many styles, Isometric games like Chris Sawyer's simulation games (Transport and Rollercoaster Tycoons), and strategy games, like the mid-C&C series (Tiberian Sun, Red Alert 2 / Yuri's Revenge, though both used voxels for units iirc) I'm not sure myself whether th...
by zorg
Mon Oct 06, 2014 12:36 pm
Forum: General
Topic: How would I go about this?
Replies: 4
Views: 1925

Re: How would I go about this?

From what you wrote, i believe you want something like this: when zooming in, you probably have a set scale that you use; you can use that, and the panning values to calculate the area you would need to re-render that one "view". Problem is, you're trying to draw an infinitely detailed... ...
by zorg
Fri Oct 03, 2014 7:04 pm
Forum: General
Topic: [SOLVED] About drawing images on screen
Replies: 4
Views: 1332

Re: [QUESTION] About drawing images on screen

It does not matter where your project folder is, as long as the assets are inside that folder; love.filesystem handles files relatively, with the "top" folder being... both the project's and the save directory. As for me recommending the use of love.filesystem functions instead of io funct...
by zorg
Fri Oct 03, 2014 4:57 pm
Forum: General
Topic: [SOLVED] About drawing images on screen
Replies: 4
Views: 1332

Re: [QUESTION] About drawing images on screen

You are correct, that you are to draw things inside love.graphics, and for actually creating the stuff you want to draw (like making a new image with love.graphics.newImage) can be done as you did, in love.load, or somewhere where it's not called every frame. (calling this in love.draw would needles...
by zorg
Fri Oct 03, 2014 12:04 pm
Forum: General
Topic: this blog post looks weird
Replies: 8
Views: 2758

Re: this blog post looks weird

My guess: The code box works with one type of line-end, and it was written with anoter (e.g. CRLF and LF), but i might be wrong.
by zorg
Thu Oct 02, 2014 6:13 am
Forum: Support and Development
Topic: [SOLVED] Nested context scale doesn't work
Replies: 4
Views: 2199

Re: Nested context scale doesn't work

Sorry I should have been more clear, the scaling is an issue because I need to retain the translation and rotation but reset the scale. this is because I am drawing many canvases, then having them all added to a last one that I want to scale up. in that case, the code: love.graphics.translate(tx,ty...
by zorg
Wed Oct 01, 2014 8:07 am
Forum: Support and Development
Topic: [SOLVED] Nested context scale doesn't work
Replies: 4
Views: 2199

Re: Nested context scale doesn't work

Untested, but you probably want something like this: function love.draw() love.graphics.push() love.graphics.scale(scale) love.graphics.push() love.graphics.origin() -- the addition; reset all transformations. love.graphics.scale(1) -- This does not work at all local w, h = love.graphics.getWidth(),...
by zorg
Wed Sep 17, 2014 7:40 am
Forum: Support and Development
Topic: String format related question
Replies: 5
Views: 2451

Re: String format related question

Edit: Roland explained what i tried to better below me DaedalusYoung probably meant this then: TEsound.play("assets/music/" .. songname[filename] .. ".mp3") On the other hand, when sorting, you could sort with using gsub and a pattern that returns only what's after the last /, o...
by zorg
Wed Sep 10, 2014 9:57 am
Forum: General
Topic: Checking pixels on a line
Replies: 4
Views: 1863

Re: Checking pixels on a line

Keep in mind that using getPixel constantly is probably (a lot) slower than pulling the whole image into a lua-table and accessing that. On the other hand, tables have some overhead in memory, while imagedata is (to my knowledge) just a simple c array holding byte quadruplets for the pixel colors; ...