Welcome, Guest. Please login or register. Did you miss your activation email?

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - Francismoy

Pages: [1]
1
General / Re: [Solved]SFML widget in Qt
« on: April 26, 2014, 12:01:04 pm »
Thanks for the fix! :)

I edited the tutorial in my blog to include the problem and the solution.

2
General / Re: SFML widget in Qt
« on: March 16, 2014, 11:41:28 pm »
Hi

I'm the creator of the post that you refer to.

It's my impression that you're using Windows instead of Mac OS. From the error message, I think that the create method (RenderWindow::create) requires a pointer to a windows handler (HWND *) and does not accept a explicit casting to (void *). Unfortunately, I haven't tried this on Windows, so for now it's the only hint I can provide.

Hope some other friends shed some more light on this issue.

FM

3
Window / Re: SFML 2.0 and QT 5 Integration
« on: October 24, 2013, 11:16:25 am »
Hi,

I've been playing around with this issue and I got to make the integration :). However, I did it only for Mac OS, but anyway I guess it could be of help even if you use Windows or Linux. I posted the details on my blog: http://becomingindiedev.blogspot.fr/2013/10/qt-5-and-sfml-20-integration.html

Hope it helps a little bit! And ask me if you have any questions.
FM

4
Graphics / Re: On Parallax Scrolling
« on: July 23, 2013, 10:51:32 am »
Thanks for the quick answer! :)

I'll try it later and let you know the results.

5
Graphics / On Parallax Scrolling
« on: July 23, 2013, 09:22:55 am »
Hi all!

I submitted this question in an old post about parallax scrolling, but I didn't get an answer (the post was quite old, from 2011 or earlier I think).

I want to implement parallax scrolling. My approach is the following: I have two different classes, 'layer' and 'level'. A level is composed by a set of layers, and a layer is onto where the objects are drawn. During the level setup, I create its layers, and I assign a scroll velocity to each layer, which is actually a velocity of the view for that layer.

//Pseudo-code
layer1.setScrollVelocity(1.0f);
layer2.setScrollVelocity(0.5f); //layer 2 moves half slower than layer 1

In the update function of the frame, I update the position of all the objects in the layer and the movement of the layer itself by moving the view associated to the layer.

This seems to work fine for me, and has the expected effect, but I have another problem. I'd like to check whether I'm on any screen border in order to stop the movement of the layer. However, I don't know how to do this. If the layer (e.g. a background) is moving at a factor of 1.0, it's straightforward, as I can check if the position of the player is the size of the bitmap that fills the background. However, if the factor is less (and therefore is moving slower), I don't know how to check.

At the beginning, I assumed that if the background (view) moves at 0.5f, and the width of the background bitmap is 2000 pixels, I should arrive at the right border when the character is 4000, but this doesn't seem to work.

Any ideas?
Thanks in advance.

6
Graphics / Re: Best way to achieve parallax scrolling?
« on: July 05, 2013, 01:01:09 pm »
Hi!

I know it's too late maybe, but I'd like to re-open the discussion.

My approach is the following: I have two different classes, 'layer' and 'level'. A level is actually composed by a set of layers, and a layer is onto where the objects are drawn. During the level setup, I create its layers, and I assign a scroll velocity to each layer.

layer1.setScrollVelocity(1.0f);
layer2.setScrollVelocity(0.5f); //layer 2 moves half slower than layer 1

In the update function of the frame, I update the position of all the objects in the layer and the movement of the layer itself.

This seems to work fine for me, but I have another problem. I'd like to check whether I'm on any screen limit in order to stop the movement of the layer. However, I don't know how to do this. If the layer (e.g. a background) is moving at a factor of 1.0, it's straightforward, as I can check if the position of the player is the size of the bitmap that fills the background. However, if the factor is less (and therefore is moving slower), I don't know how to check.

At the beginning, I assumed that if the background moves at 0.5f, and the width of the background bitmap is 2000 pixels, I should arrive at the right limit when the character is 4000, but this doesn't seem to work.

Any ideas?



Pages: [1]
anything