Search found 130 matches

by norubal
Wed Nov 18, 2020 1:25 pm
Forum: Support and Development
Topic: love.graphics.print troubles
Replies: 4
Views: 519

Re: love.graphics.print troubles

Try this

Code: Select all

resolutionw = love.graphics.getWidth()
resolutionh = love.graphics.getHeight()
Instead of this.

Code: Select all

local resolutionw = love.graphics.getWidth()
local resolutionh = love.graphics.getHeight()
http://lua-users.org/wiki/ScopeTutorial
by norubal
Tue Nov 17, 2020 2:26 pm
Forum: Support and Development
Topic: Implementing turn-based time system
Replies: 3
Views: 452

Re: Implementing turn-based time system

Thanks pgimeno , I checked https://ironypolicy.wordpress.com/2014/02/05/possession-2-speed-systems-in-roguelikes/ and solved it: First, I added "energy" and "energygen" field for each entities, and changed "movedelay" to "movecost". "energy" represents how much energy entity has, "energygen" represe...
by norubal
Tue Nov 17, 2020 9:09 am
Forum: Support and Development
Topic: Implementing turn-based time system
Replies: 3
Views: 452

Implementing turn-based time system

First, I apologize for another "I can't make this" question. Currently I'm trying to implementing turn-based time system. .love file is what I made - you can move player and enemies will move towards player using Jumper library. turnsystem.png turnsystem.love But this is my problem: I want to apply ...
by norubal
Tue Nov 17, 2020 8:51 am
Forum: Support and Development
Topic: Buttons on android?
Replies: 3
Views: 678

Re: Buttons on android?

I can't name library for android GUI, but this is code what I use: (I tried to comment in English, my bad if you can't understand well.) -- love.touchpressed / love.touchmoved / love.touchreleased -- Those are essential callback function for android touch event handling -- But those callback functio...
by norubal
Sat Nov 14, 2020 4:40 am
Forum: Support and Development
Topic: Scaling and scaling xy values?
Replies: 3
Views: 597

Re: Scaling and scaling xy values?

You have to *scale* mouse coordinates.

Code: Select all

function love.mousepressed(x, y)
    x = x * SCALE
    y = y * SCALE
    -- handle mousepressed events...
end
by norubal
Fri Nov 13, 2020 8:59 am
Forum: Support and Development
Topic: Scaling and camera offset
Replies: 4
Views: 1220

Re: Scaling and camera offset

I love you all :)
by norubal
Tue Nov 10, 2020 7:11 am
Forum: Support and Development
Topic: Scaling and camera offset
Replies: 4
Views: 1220

Re: Scaling and camera offset

:oops: I found solution according to this post: https://love2d.org/forums/viewtopic.php?f=4&t=77714 -- scaling if love.keyboard.isDown("q") or love.keyboard.isDown("e") then local zoominc if love.keyboard.isDown("q") then zoominc = -zoomspeed * dt elseif love.keyboard.isDown("e") then zoominc = zoom...
by norubal
Tue Nov 10, 2020 6:34 am
Forum: Support and Development
Topic: Scaling and camera offset
Replies: 4
Views: 1220

Scaling and camera offset

Hi. I have a problem with code that I'm working on nowadays. Please check my .love file: cam.love It's advanced hamster ball, player can move character with left/up/right/down key, but player can also move camera with w/a/s/d and zoom in/out camera with q, e key. It works well but this is where the ...
by norubal
Thu Feb 09, 2017 3:26 pm
Forum: Support and Development
Topic: Forced image scaling in LOVE?
Replies: 3
Views: 1570

Re: Forced image scaling in LOVE?

I found out it's related with my display settings.
scaling.png
scaling.png (42.2 KiB) Viewed 1550 times
If I change this value to '100%', love(or mspaint, whatever) won't scale so image will show normal.
But I'm still wondering why this happen, and there are any way to prevent scaling at higher dpi than 100%.
by norubal
Thu Feb 09, 2017 2:04 pm
Forum: Support and Development
Topic: Forced image scaling in LOVE?
Replies: 3
Views: 1570

Forced image scaling in LOVE?

Hello, love users! I have a simple code to draw jpg image on screen. (Please check love file.) function love.load() img = love.graphics.newImage("img.jpg") end function love.draw() love.graphics.draw(img) end I have done nothing with scaling. But if I launch it, it displays like this: (I opened orig...