Why won't my rectangle go bigger than 800 x 600?

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.
badfitz66
Prole
Posts: 30
Joined: Sat Jun 07, 2014 10:30 pm

Why won't my rectangle go bigger than 800 x 600?

Post by badfitz66 »

I'm trying to create a simple space simulation with a sun which has 'planets' orbiting it (and moons orbiting those planets, etc).

One of the things I'm using in this project is the light and shadow engine (more specifically, the refactored version found here: https://github.com/tanema/light_world.lua) and I have to draw a rectangle in the lightWorld:draw function because lights and shadows will only be rendered/appear inside the bounds of that rectangle.

However, for some reason I can't get the rectangle to be bigger than 800 x 600 (or atleast nothing is rendering outside the bounds of of 800x600). I've tried setting it to the screen size (which is currently set to 1200x900) to no avail. Currently I'm 'brute-forcing' it by setting it's width and height to 10000 and it's STILL not rendering anything outside of 800x600.

My current code (yes, it's inside love.draw incase it not being in there was of any suspicion.)

Code: Select all

	
	lightWorld:draw(function()
		love.graphics.setColor(255,255,255)
		love.graphics.rectangle("fill",0,0,10000,10000)
	end)
User avatar
Sir_Silver
Party member
Posts: 286
Joined: Mon Aug 22, 2016 2:25 pm
Contact:

Re: Why won't my rectangle go bigger than 800 x 600?

Post by Sir_Silver »

I haven't used Lightworld yet, but I did check out the link you mentioned...

Have you tried calling the lightWorld:refreshScreenSize(width, height) function?
badfitz66
Prole
Posts: 30
Joined: Sat Jun 07, 2014 10:30 pm

Re: Why won't my rectangle go bigger than 800 x 600?

Post by badfitz66 »

Can't seem to get it to do anything.
User avatar
Sir_Silver
Party member
Posts: 286
Joined: Mon Aug 22, 2016 2:25 pm
Contact:

Re: Why won't my rectangle go bigger than 800 x 600?

Post by Sir_Silver »

badfitz66 wrote: Fri Sep 29, 2017 9:57 am Can't seem to get it to do anything.
Care to be more explicit? Did you call that function I mentioned previously, supplying love.graphics.getDimensions() to the function?

What I inferred from your first post was that your lightworld isn't drawing to the full size of your window dimensions, right? Like, it's only drawing at a size of 800 x 600 (your original screen dimensions) but you want it to fill up the space of your new screen dimensions (1200 x 900), is that correct?

If that is the case, I do believe this is the function you want to use. If that isn't the problem, then I don't quite understand what it is.
badfitz66
Prole
Posts: 30
Joined: Sat Jun 07, 2014 10:30 pm

Re: Why won't my rectangle go bigger than 800 x 600?

Post by badfitz66 »

I have my screen set to 1200x900 on start up (with resizeable set to true). Nothing happens.

Here's my full love.draw() code:

Code: Select all

function love.draw()
	local width, height, flags = love.window.getMode( )
	lightWorld:refreshScreenSize(1200,900)--nothing happens whether or not I put it inside lightWorld:draw						
	lightWorld:draw(function()
		love.graphics.setColor(255,255,255)
		love.graphics.rectangle("fill",0,0,10000,10000)
	end)
	love.graphics.setColor(255,255,255,255/4)	
	for _, star2 in pairs(distantstars) do
		love.graphics.circle("fill",star2.x,star2.y,star2.radius,star2.segments)
	end
	blur:draw(function()	--draw a glow around each star
		for _, star in pairs(distantstars) do
			love.graphics.circle("fill",star.x,star.y,star.radius,star.segments)
		end
	end)
	
	love.graphics.setColor(100,100,100)
	SolarSystem:draw()
end
User avatar
Nikki
Citizen
Posts: 87
Joined: Wed Jan 25, 2017 5:42 pm

Re: Why won't my rectangle go bigger than 800 x 600?

Post by Nikki »

I had a tiny peek in that light_world.lua/main.lua file

I spotted at least 2 places where 800, 600 is hardcoded
https://github.com/tanema/light_world.l ... in.lua#L79
https://github.com/tanema/light_world.l ... n.lua#L193
badfitz66
Prole
Posts: 30
Joined: Sat Jun 07, 2014 10:30 pm

Re: Why won't my rectangle go bigger than 800 x 600?

Post by badfitz66 »

It's almost like that's the code for an example that comes with the library and not my code/the library itself 🤔🤔🤔🤔🤔
User avatar
zorg
Party member
Posts: 3468
Joined: Thu Dec 13, 2012 2:55 pm
Location: Absurdistan, Hungary
Contact:

Re: Why won't my rectangle go bigger than 800 x 600?

Post by zorg »

badfitz66 wrote: Sat Sep 30, 2017 3:33 pm It's almost like that's the code for an example that comes with the library and not my code/the library itself 🤔🤔🤔🤔🤔
It's almost like you failed to give us a .love file of your complete project so we could see what you did and did not modify in the lightworld library itself. :|
Me and my stuff :3True Neutral Aspirant. Why, yes, i do indeed enjoy sarcastically correcting others when they make the most blatant of spelling mistakes. No bullying or trolling the innocent tho.
badfitz66
Prole
Posts: 30
Joined: Sat Jun 07, 2014 10:30 pm

Re: Why won't my rectangle go bigger than 800 x 600?

Post by badfitz66 »

It's almost like you failed to give us a .love file of your complete project so we could see what you did and did not modify in the lightworld library itself. :|
it's almost like I was able to be able to locate the problem down to the function (love.draw/lightworld:draw()) before posting this (however I should've probably stated I was able to locate it down to those functions) so giving a .love file would be redundant since I was 100% sure that there was nothing anywhere else in the code that could've done this.

And before you say 'but how do you know it isn't something else in your code'

I know because I fixed it by putting lightworld:refreshScreenSize into love.resize() rather than love.draw() which proves that I was correct with my assumption that it was with love.draw and nothing somewhere else in the code nor a problem with the library. Therefore a .love file would've been redundancy.

I would've also stated if I modified the library itself.
User avatar
Beelz
Party member
Posts: 234
Joined: Thu Sep 24, 2015 1:05 pm
Location: New York, USA
Contact:

Re: Why won't my rectangle go bigger than 800 x 600?

Post by Beelz »

It's almost like you're asking people to jump through hoops to help you, but complaining that they asked for bigger hoops. Including the love file in the first place would remove the guesswork you place upon them, whether or not you pinpointed the problem. Remember, everyone has their own projects to work on, be grateful they put time into helping at all.

Code: Select all

if self:hasBeer() then self:drink()
else self:getBeer() end
GitHub -- Website
Post Reply

Who is online

Users browsing this forum: Google [Bot] and 8 guests