slime wrote:josefnpat wrote:Code: Select all
cool_joe = love.video.newVideo('cool_joe')
function love.graphics.draw()
love.video.draw( cool_joe )
drawFractal() -- Draw a crazy fractal on top of your video!
end
You should update the code to make it use something other than love's namespace – it's bad practice in general to do that, plus if/when a real love.video module gets added to LÖVE then any code that overwrites love.video for its own purposes (such as the above snippet) will cause the real love.video to break horribly.
Haha, sorry, the previous examples in this thread are totally bogus;
It's not actually in love's namespace, it's just put there in the examples. Here is an example from the readme.md;
Code: Select all
LoveVideo = require "LoveVideo.lovevideo"
bunny = LoveVideo.newVideo("big_buck_bunny")
function love.draw()
bunny:draw(0,0,
love.graphics.getWidth()/bunny:getWidth(), -- x scale
love.graphics.getHeight()/bunny:getHeight() -- y scale
)
end
function love.update(dt)
bunny:update(dt)
end
So s/love\.video/not_love_video/gc?
Zilarrezko wrote:Maybe it's a hint that he wants you to implement his library, slime. :awesome:
Cool stuff though, I wish I had the brain capacity to use magic and threads like that. :o
Honestly, just the example is
kind of a joke; I think we
should have a video decoder in love. While many may see it as superfluous and useless, it does hamper creativity in some ways. I saw
PewDiePie playing the game Roundabout, and I realized that while the example is very silly, it's a very good example of storytelling by cutscenes. I'd be happy to change the example if a love.video emerges in the 0.10+ branch! I by no means want to create a library that would screw with the blessed' namespace.
bartbes wrote:slime wrote:
Causing a real love.video to break when this one is used is an odd way to encourage me. :P
I don't know, you do love breaking things.
Breaking things is what FOSS is all about! I suppose this module is a challenge for the love team to make love.video a real decoder.
That's fantastic! Did you find any part of the API lacking? I was hoping someone would make a video player like thing out of this.