Search found 3449 matches

by zorg
Wed Oct 15, 2014 2:28 am
Forum: General
Topic: [HELP] Making a Save button
Replies: 29
Views: 12990

Re: [HELP] Making a Save button

function love.mousepressed(x,y,button) -- if mouse is clicked with left button over the save button, trigger saving and open the folder containing the file if button == 'l' and x > savebutton.x and x <= savebutton.x+savebutton.w and y > savebutton.y and y <= savebutton.x+savebutton.w then saveImage...
by zorg
Tue Oct 14, 2014 3:55 pm
Forum: General
Topic: [HELP] Making a Save button
Replies: 29
Views: 12990

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

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

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

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

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

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

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

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

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(),...