Search found 82 matches

by unixfreak
Sat Apr 08, 2017 5:30 pm
Forum: Support and Development
Topic: [SOLVED] Dynamic camera scaling dependent on resolution?
Replies: 3
Views: 2743

Re: Dynamic camera scaling dependent on resolution?

Here's how I do it. I also usually do letterboxing but that's an extra step I'll just drop for now. Side thing: if you're making a horizontal platformer, maybe you'd prefer to only ever use scale_x, so that the distance between the player and the edge of the screen is fixed and same deal for a vert...
by unixfreak
Sat Apr 08, 2017 5:05 pm
Forum: Support and Development
Topic: [SOLVED] Dynamic camera scaling dependent on resolution?
Replies: 3
Views: 2743

Re: Dynamic camera scaling dependent on resolution?

Well more fiddling about this seems to work: local scale = (default_width / (love.graphics.getWidth() * love.graphics.getHeight()) *1000) camera.scaleX = scale camera.scaleY = scale Although the width is not perfect, how can i improve that to get the exact horizontal view distance in any resolution?
by unixfreak
Sat Apr 08, 2017 4:32 pm
Forum: Support and Development
Topic: [SOLVED] Dynamic camera scaling dependent on resolution?
Replies: 3
Views: 2743

[SOLVED] Dynamic camera scaling dependent on resolution?

Math has never been my strong point, and i'm in a pickle figuring this out for a platformer engine i've been making. The default window size is 1024 x 768, when not fullscreen. Let's say the user had 1920 x 1080 as their resolution, when toggling into fullscreen (desktop) mode the window will simply...
by unixfreak
Wed Dec 07, 2016 1:44 pm
Forum: Support and Development
Topic: "Questions that don't deserve their own thread" thread
Replies: 905
Views: 410929

Re: "Questions that don't deserve their own thread" thread

I'm trying to set a randomly rotated image But i only end up with integers, for example; -- returns 0,1,2,3 love.math.random(math.pi) -- same as above love.math.random(0.0, math.pi) The angle of a placed image isn't as random as i'd like it to be. How can i get math.random / love.math.random to choo...
by unixfreak
Sat Nov 12, 2016 3:13 am
Forum: Libraries and Tools
Topic: lovesplash (a simple module to aid with splash screens)
Replies: 3
Views: 2372

Re: lovesplash (a simple module to aid with splash screens)

D0NM wrote:I like it. It is quite simple )

You might add some code quotations into your 1st message. It would be more informative.
People with old / newer LOVE will not be able to see your project on download. See?
Thanks, i just updated the post.
by unixfreak
Fri Nov 11, 2016 5:50 am
Forum: Libraries and Tools
Topic: lovesplash (a simple module to aid with splash screens)
Replies: 3
Views: 2372

lovesplash (a simple module to aid with splash screens)

This is pretty basic, but i hope it can help someone out. :awesome: I've not written a proper module before, so this is my first attempt at one, hoping it's in a usable state. Actually if i'm doing anything wrong module wise, any feedback would be great, thanks. This module is probably best used for...
by unixfreak
Wed Nov 02, 2016 6:49 pm
Forum: Support and Development
Topic: [SOLVED] Problem with canvas + camera drawing
Replies: 6
Views: 3444

Re: Problem with canvas + camera drawing

Okay, i figured out a solution to the canvas drawing, i simply had to unset my camera before drawing to the canvas, then set the camera again just before drawing the actual canvas. Solved i guess.
by unixfreak
Wed Nov 02, 2016 6:33 pm
Forum: Support and Development
Topic: [SOLVED] Problem with canvas + camera drawing
Replies: 6
Views: 3444

Re: Problem with canvas + camera drawing

It seems to me that the problem is that the camera transform applies to drawing the stuff on the canvas and then again to the drawing of the canvas on the screen. Could you maybe use a scissor instead, to avoid drawing out of the border? It will probably be faster than a canvas. How can i do that? ...
by unixfreak
Wed Nov 02, 2016 1:20 am
Forum: Support and Development
Topic: [SOLVED] Problem with canvas + camera drawing
Replies: 6
Views: 3444

Re: Problem with canvas + camera drawing

Well i changed it to draw as a quad, in arena:draw() function arena:draw() local tile = arena.textures["floor"] tile:setWrap("repeat","repeat") love.graphics.setColor(255,255,255,255) local quad = love.graphics.newQuad( arena.x,arena.y,arena.width,arena.height, tile:get...
by unixfreak
Wed Nov 02, 2016 1:05 am
Forum: Support and Development
Topic: [SOLVED] Problem with canvas + camera drawing
Replies: 6
Views: 3444

[SOLVED] Problem with canvas + camera drawing

Hello... strange issue that's been baffling me and i have tried everything i can think of, but still not found why this is happening. Basically, i have an arena where the player can move around the screen. An image is tiled over the arena for the floor. My problem is, if i draw it directly to the sc...