Textured Polygons for All!
- xXxMoNkEyMaNxXx
- Party member
- Posts: 206
- Joined: Thu Jan 10, 2013 6:16 am
- Location: Canada
Re: Textured Polygons for All!
Ref, you need to send it the new sizeY! The forgettable SO ANNOYING variable.
Re: Textured Polygons for All!
Sure, thanks. Gotta try that.xXxMoNkEyMaNxXx wrote:@IndieKid If you can get the positions on screen, it will put an image on it, so it should already support that... This basically replaces the part where you call love.graphics.polygon with a funtion that will draw the polygon and put an image on it.
Re: Textured Polygons for All!
Knew it was something obvious.xXxMoNkEyMaNxXx wrote:Ref, you need to send it the new sizeY! The forgettable SO ANNOYING variable.
Thanks xXxMonNkEyMaNxXx!
Now working great!
Previous demo replaced.
Effect definitely works with canvases!
- Jasoco
- Inner party member
- Posts: 3726
- Joined: Mon Jun 22, 2009 9:35 am
- Location: Pennsylvania, USA
- Contact:
Re: Textured Polygons for All!
So any idea on how to fix the "module unloaded after setMode" problem? I can't have my game change its resolution while in game and still have the texture module work. As soon as I call setMode the module stops working and it doesn't work again until I restart because I can't just require the module again because it doesn't work. Any way to force it?
Re: Textured Polygons for All!
love.filesystem.load?
lf = love.filesystem
ls = love.sound
la = love.audio
lp = love.physics
lt = love.thread
li = love.image
lg = love.graphics
ls = love.sound
la = love.audio
lp = love.physics
lt = love.thread
li = love.image
lg = love.graphics
- Jasoco
- Inner party member
- Posts: 3726
- Joined: Mon Jun 22, 2009 9:35 am
- Location: Pennsylvania, USA
- Contact:
Re: Textured Polygons for All!
MonkeyMan said it should be loaded as a module. Which is what I am doing.Nixola wrote:love.filesystem.load?
Code: Select all
texture=require 'Perspective'
Re: Textured Polygons for All!
Well, lf.load does the same thing, except it will execute the file again if already loaded and it allows you to have multiple instances of a module, if it doesn't use globals
lf = love.filesystem
ls = love.sound
la = love.audio
lp = love.physics
lt = love.thread
li = love.image
lg = love.graphics
ls = love.sound
la = love.audio
lp = love.physics
lt = love.thread
li = love.image
lg = love.graphics
- xXxMoNkEyMaNxXx
- Party member
- Posts: 206
- Joined: Thu Jan 10, 2013 6:16 am
- Location: Canada
Re: Textured Polygons for All!
What is the problem with reloading the module?
I was upset because my uber-efficient code (at least in my eyes) had been butchered. You can obviously do whatever you want, but I can only hope that you will be efficient.This was made to be a module, PLEASE USE IT AS A MODULE
- Jasoco
- Inner party member
- Posts: 3726
- Joined: Mon Jun 22, 2009 9:35 am
- Location: Pennsylvania, USA
- Contact:
Re: Textured Polygons for All!
It doesn't work. Using love.filesystem.load that is. If I try to load it I get the following errors:xXxMoNkEyMaNxXx wrote:What is the problem with reloading the module?I was upset because my uber-efficient code (at least in my eyes) had been butchered. You can obviously do whatever you want, but I can only hope that you will be efficient.This was made to be a module, PLEASE USE IT AS A MODULE
love.filesystem.load("Perspective.lua")()
Code: Select all
Error: Perspective.lua:151: bad argument #1 to 'module' (string expected, got no value)
stack traceback:
[C]: in function 'module'
Perspective.lua:151: in main chunk
main.lua:107: in function 'load'
main.lua:61: in function <main.lua:56>
[C]: in function 'xpcall'
love.filesystem.load("Perspective.lua")
Code: Select all
Error: draw.lua:89: attempt to index global 'texture' (a function value)
stack traceback:
draw.lua:89: in function 'drawTriangles'
draw.lua:12: in function 'drawGamePolys'
game.lua:51: in function 'draw'
main.lua:148: in function 'draw'
main.lua:86: in function <main.lua:56>
[C]: in function 'xpcall'
Just using texture = require 'Perspective' after it has already been loaded and setMode has been used results in the textures not working anymore.
- Robin
- The Omniscient
- Posts: 6506
- Joined: Fri Feb 20, 2009 4:29 pm
- Location: The Netherlands
- Contact:
Re: Textured Polygons for All!
Have you tried
love.filesystem.load("Perspective.lua")("Perspective.lua")?
(By the way, boo module)
love.filesystem.load("Perspective.lua")("Perspective.lua")?
(By the way, boo module)
Help us help you: attach a .love.
Who is online
Users browsing this forum: Bing [Bot] and 0 guests