Search found 2618 matches

by zorg
Tue Oct 14, 2014 3:55 pm
Forum: General
Topic: [HELP] Making a Save button
Replies: 29
Views: 5194

Re: [HELP] Making a Save button

Or just call those two from within the clicking function...
that can be as easy as using the love.mousepressed callback, and some math to figure out whether you clicked on your button or not.
by zorg
Sat Oct 11, 2014 1:41 pm
Forum: Support and Development
Topic: Loading File by Game State
Replies: 5
Views: 1415

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 state (thou...
by zorg
Thu Oct 09, 2014 11:58 am
Forum: General
Topic: What's your favorite type of 2D game?
Replies: 12
Views: 2863

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 the fi...
by zorg
Mon Oct 06, 2014 12:36 pm
Forum: General
Topic: How would I go about this?
Replies: 4
Views: 1389

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... thing, so ...
by zorg
Fri Oct 03, 2014 7:04 pm
Forum: General
Topic: [SOLVED] About drawing images on screen
Replies: 4
Views: 922

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 functions, a bi...
by zorg
Fri Oct 03, 2014 4:57 pm
Forum: General
Topic: [SOLVED] About drawing images on screen
Replies: 4
Views: 922

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: 1769

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: 1617

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: 1617

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: 1436

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 /, or in other words, th...