"Questions that don't deserve their own thread" thread
Forum rules
Before you make a thread asking for help, read this.
Before you make a thread asking for help, read this.
- Cryogenical
- Prole
- Posts: 49
- Joined: Mon Apr 28, 2014 5:23 pm
Re: "Questions that don't deserve their own thread" thread
It did nothing but change the size of my window. Still had borders.
- Jasoco
- Inner party member
- Posts: 3727
- Joined: Mon Jun 22, 2009 9:35 am
- Location: Pennsylvania, USA
- Contact:
Re: "Questions that don't deserve their own thread" thread
Are you trying to remove the border or make the window resizable? Because they're two separate things. Just add "borderless = true" to that table. Go to the Wiki and look up love.window.setMode(). There's a lot of settings in there to play with.Cryogenical wrote:It did nothing but change the size of my window. Still had borders.
- Zilarrezko
- Party member
- Posts: 345
- Joined: Mon Dec 10, 2012 5:50 am
- Location: Oregon
Re: "Questions that don't deserve their own thread" thread
What system do you have? Because I know windows 8 won't get rid of borders unless you make it borderless and make it not resizeable.Cryogenical wrote:It did nothing but change the size of my window. Still had borders.
Sorry I probably forgot to put in borderless.
Code: Select all
local resizeable = false
local borderless = false
function love.keypressed(key, unicode)
if key == "5" then
resizeable = not resizeable
borderless = not borderless
love.window.setMode(1080, 720, {resizable = resizeable, borderless = borderless})
end
end
- Cryogenical
- Prole
- Posts: 49
- Joined: Mon Apr 28, 2014 5:23 pm
Re: "Questions that don't deserve their own thread" thread
Closer, but the window was still resizeable.
I am running on windows 8 sadly.
I fixed it by either changing the local variable for resizeable to true, or just getting rid of the function of resizeable = not resizeable.
Thank you guys though! Helps a lot.
I am running on windows 8 sadly.
I fixed it by either changing the local variable for resizeable to true, or just getting rid of the function of resizeable = not resizeable.
Thank you guys though! Helps a lot.
Re: "Questions that don't deserve their own thread" thread
Somehow my brain can't process why this
doesn't work like this:
Code: Select all
return content and content:isPassable() or true;
Code: Select all
if content then
return content:isPassable();
else
return true;
end
- Robin
- The Omniscient
- Posts: 6506
- Joined: Fri Feb 20, 2009 4:29 pm
- Location: The Netherlands
- Contact:
Re: "Questions that don't deserve their own thread" thread
Because
is the same as
which returns c if either a or b is falsy, otherwise it returns b.
What you want is
Code: Select all
a and b or c
Code: Select all
(a and b) or c
What you want is
Code: Select all
return not content or content:isPassable()
Help us help you: attach a .love.
Re: "Questions that don't deserve their own thread" thread
Ah ... so the statement would return true, if isPassable() returns false. That's where the mistake was. I thought it would directly return the result of isPassable() if there was content and return true if there wasn't.
Thanks for the explanation.
Thanks for the explanation.
-
- Party member
- Posts: 106
- Joined: Sat Jun 21, 2014 3:45 pm
Re: "Questions that don't deserve their own thread" thread
How do I use getPointer with FFI on an ImageData object to change a certain pixel in it? Is the ImageData array two dimensional, and what variable names do the pixel colors use?
- slime
- Solid Snayke
- Posts: 3170
- Joined: Mon Aug 23, 2010 6:45 am
- Location: Nova Scotia, Canada
- Contact:
Re: "Questions that don't deserve their own thread" thread
If you use this (all you need to do is require the file) then you'll get the performance of LuaJIT's FFI when calling ImageData methods, without having to worry about whether your C pointer / array arithmetic is correct.
Re: "Questions that don't deserve their own thread" thread
I wrote a shader yesterday, which allows me to cycle through different colour palettes. Since I am pretty new to shaders I used a pretty brute-force approach:
It works fine for the colour cycling part, but not for transparent images. When I set love.graphics.setColor(255, 255, 255, 0), it still shows the sprite at 100 % opacity. I know I have to do something with the alpha, but I'm not sure what :S
Code: Select all
vec4 effect( vec4 color, Image texture, vec2 texture_coords, vec2 screen_coords )
{
vec4 tex = Texel(texture, texture_coords);
if (tex.r == 0 && tex.g == 0 && tex.b == 0) { // Black
tex.r = PALETTE[0][0];
tex.g = PALETTE[0][1];
tex.b = PALETTE[0][2];
} else if (tex.r == 1.0 && tex.g == 1.0 && tex.b == 1.0) { // White
tex.r = PALETTE[1][0];
tex.g = PALETTE[1][1];
tex.b = PALETTE[1][2];
} else if (tex.r >= 0.5 && tex.g >= 0.5 && tex.b >= 0.5) { // Light Gray
tex.r = PALETTE[2][0];
tex.g = PALETTE[2][1];
tex.b = PALETTE[2][2];
} else if (tex.r >= 0.2 && tex.g >= 0.2 && tex.b >= 0.2) { // Dark Gray
tex.r = PALETTE[3][0];
tex.g = PALETTE[3][1];
tex.b = PALETTE[3][2];
}
// This will make every pixel of the sprite opaque.
// tex.a = color.a;
return tex;
}
Who is online
Users browsing this forum: No registered users and 13 guests