Search found 61 matches

by Xugro
Thu Aug 10, 2017 7:50 pm
Forum: General
Topic: Need example code for grab and drop object with mouse?
Replies: 4
Views: 1097

Re: Need example code for grab and drop object with mouse?

Here is an example code that does the same thing as your Javascript example. :)
by Xugro
Sun Aug 06, 2017 6:19 pm
Forum: Support and Development
Topic: Exchanging one color for a different one
Replies: 5
Views: 1022

Re: Exchanging one color for a different one

You can also use Blendmodes to change the colors. I attached a small example code with the replacement function. It takes an image and two colors and gives you a canvas back with the new image. But it is costly to use every frame, because it create three canvas every time.
by Xugro
Wed Jul 26, 2017 8:00 pm
Forum: Support and Development
Topic: Simulating graphics.rotate by using other functions?
Replies: 6
Views: 1416

Re: Simulating graphics.rotate by using other functions?

It is pretty simple since rotate, scale and shear are all linear transformations described by matrices (see source: /src/common/Matrix.cpp). You just have to multiply them and compare coefficients.

I attached a simple example.
by Xugro
Fri Mar 31, 2017 1:13 pm
Forum: Games and Creations
Topic: Minimal Tower Defense
Replies: 1
Views: 1493

Re: Minimal Tower Defense

Nice game! :)

It took me a while to find a good strategy but then it was really easy. And I found a little bug: You can build towers below the last row. Take a look at the screenshot for both.
by Xugro
Fri Mar 31, 2017 1:10 pm
Forum: Support and Development
Topic: Make background image scrolling, an reapeating endless with only update part
Replies: 2
Views: 1433

Re: Make background image scrolling, an reapeating endless with only update part

Since both positions of the background images advances at the same speed you do not need to calculate both. The only difference between the two is the height of the image (plus or minus). So you only have to draw them with an offset of the height of the image. I attached an example of this. But you ...
by Xugro
Tue Dec 27, 2016 1:29 pm
Forum: Games and Creations
Topic: Video puzzle
Replies: 9
Views: 2920

Re: (buggy) video puzzle

bob_fossil wrote:Perhaps you can change the title of this thread now? :)
Done! :)

And I updated the first post to contain the newest version.
by Xugro
Mon Dec 26, 2016 9:07 am
Forum: Games and Creations
Topic: Video puzzle
Replies: 9
Views: 2920

Re: (buggy) video puzzle

The following function does some basic sanity tests to the file object you get from love.filedropped to see if it is in the supported format: Thank you very much! :) I hoped that there was an easier way to check this, but your solution should work pretty good. You still need to make some changes or...
by Xugro
Sun Dec 25, 2016 7:57 pm
Forum: Games and Creations
Topic: Video puzzle
Replies: 9
Views: 2920

Re: (buggy) video puzzle

Here is a new and faster version of the code. Take a look at the source if you like. The code should be easy to read. One more thing: a check for a stream format should be added. I.e. the app crashes when a wrong file format is dropped into it. That is still a thing I do not know how to do. Take a l...