Questions about the LÖVE API, installing LÖVE and other support related questions go here.
Forum rules
Before you make a thread asking for help,
read this.
-
Santos
- Party member
- Posts: 384
- Joined: Sat Oct 22, 2011 7:37 am
Post
by Santos » Fri Sep 22, 2017 12:46 pm
Neat, thanks!
Code: Select all
function love.load()
imagedata = love.image.newImageData('image.png')
width, height = imagedata:getDimensions()
compressed = love.math.compress(imagedata, 'gzip')
filedata = love.filesystem.newFileData(compressed:getString(), '')
decompressed = love.math.decompress(filedata, 'gzip')
imagedata = love.image.newImageData(width, height, decompressed)
image = love.graphics.newImage(imagedata)
end
function love.draw()
love.graphics.draw(image)
end
-
Santos
- Party member
- Posts: 384
- Joined: Sat Oct 22, 2011 7:37 am
Post
by Santos » Mon Sep 25, 2017 12:00 pm
So this is probably an SDL thing and maybe a "my computer is just weird" thing, but when I press this laptop's Fn key and press the function keys, I get unexpected results from love.keypressed.
For example, when I press Fn and F1 (which is mute), I get the key "d" (the scancodes are the same as the keys for all of these). It doesn't output the letter "d" in other applications though. Volume down and up are "c" and "b", numlock and scrolllock are as expected, display switch is "lgui" and search is "f14".
So uh, is this normal?
-
slime
- Solid Snayke
- Posts: 2918
- Joined: Mon Aug 23, 2010 6:45 am
- Location: Nova Scotia, Canada
-
Contact:
Post
by slime » Mon Sep 25, 2017 1:26 pm
Weird. I've never heard of that before - but it's not something love's code can really affect, in any case. (It'd be up to either SDL or the operating system APIs that SDL calls).
-
Santos
- Party member
- Posts: 384
- Joined: Sat Oct 22, 2011 7:37 am
Post
by Santos » Mon Sep 25, 2017 2:02 pm
Weird indeed, thanks slime.
-
Nixola
- Inner party member
- Posts: 1949
- Joined: Tue Dec 06, 2011 7:11 pm
- Location: Italy
Post
by Nixola » Mon Sep 25, 2017 5:54 pm
I have a similar bug on Linux, except it affects everything and the key is never released, meaning that it leads to stuff like ddddddddddddd typed all over what I'm doing.
lf = love.filesystem
ls = love.sound
la = love.audio
lp = love.physics
lt = love.thread
li = love.image
lg = love.graphics
Users browsing this forum: No registered users and 50 guests