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 - Grimshaw

Pages: 1 ... 30 31 [32] 33 34 ... 40
466
Graphics / [SFML2] Bounding boxes around sf::Text characters
« on: September 27, 2011, 02:58:53 am »
Any chance you're messing with OpenGL directly? seems like a possible blending state gone wrong, but at the same time i wouldnt bet on it :)

Maybe its something Mac specific, to which i cant be any help

467
Graphics / How to make a sprite that scale keeping the border radius?
« on: September 27, 2011, 02:56:18 am »
I think you're looking for a simpler version of something like the box model in  web languages.

In your place, I would make your button class with some functions to set this "box model" sprites.

Then, when you need to draw, it should go something like:

- draw corner sprite at button top-left position (pos).
- draw top sprite at pos.x + corner.width and with its width set as button.width-corner.width*2
- draw corner again, rotated.

-draw left sprite at pos.y + corner.height and dimensions as button.height-corner.height*2
-draw center sprite at position (corner.width, corner.height) and set its dimensions to be the same as top sprite for x and left sprite for y.

.. I think you can figure it from now!

Hope i helped and that i got to the point of your question.

468
Graphics / Using SFML in a resizable QT-Widget
« on: September 27, 2011, 02:41:23 am »
Firstly, the sf::RenderWindow should always fit the client area of the widget.

That means the rect that can draw things, coincides with the widget's rect, except for some possible border/margin.

Since the sf::RenderWindow took an external window handle, it should work as a proxy for the real window(the qt widget), meaning that if the widget resizes, its slave RenderWindow should get the Resize event too!

Once you catch that event, you just need to act acordingly, which normally means configuring the view for the new size!

Hope it helps!

469
General / Adding 2 Events in an SFML Application?
« on: September 27, 2011, 01:56:19 am »
Thanks a lot for the additional answer, i meant it when i said i didnt know what his point was , but that should be it :D

470
General / Adding 2 Events in an SFML Application?
« on: September 26, 2011, 01:03:44 pm »
Whats the point? If you got all events left in the first loop, why would a second event loop work at all? it just skips.

471
Audio / sf::soundbuffer plays no sound
« on: September 15, 2011, 01:12:39 am »
Maybe you're creating those objects inside a function, so they are destroyed automaticly at the end of it?

472
General discussions / Premake
« on: September 08, 2011, 01:34:28 am »
I would be really interested in this, if anyone here with a sounding word tells me i should :)

473
//What do you imagine these do, and what do you imagine they return?
TemplateList++;
TemplateList--;
--TemplateList;
++TemplateList;

 - I could only see this as iterating the list, increasing and decreasing an internal iterator!

TemplateList = Item;

Makes no effective logic to set a list as one item, but if you make it a += its a perfectly acceptable "Append"

//What do you imagine this should return?
(!TemplateList) - makes no sense to me, if its a template, the any object won't have a common logic evaluation. Therefore, what the hell wold be a negation of a list of any kind of object? Cant think of anything

Hope it helps

474
Graphics / Can Someone Help With Loading A sprite
« on: September 05, 2011, 02:19:51 am »
It looks fine, normally.

Maybe you are just missing Release libraries with Debug build, check everything and try again :)

475
Graphics / Best way to achieve parallax scrolling?
« on: September 04, 2011, 02:05:39 pm »
Changing the view should be a simple matrix multiplication as far as i know, i dont think it would be slower than changing the image any other way! :)

And if you dont want to change your approach, just make your "player_movement" the difference between the new passed camera-center and the previous one :) Should work if my mind is not failing :)

By the way, how do you guys go about those landscape images, eventually they will exceed your gpu limitations in width. Do you tile a few images or what?

476
Network / GetLocalAddress doesnt seem correct
« on: September 04, 2011, 01:59:55 pm »
When its fixed please warn us Laurent, and thanks a lot for all the support. You re the man :)

477
Graphics / Additional Windows?
« on: September 04, 2011, 04:26:07 am »
You actually need to handle events for all windows opened in a queue kind of way.

So you just have all the windows in a list or something and do something like:

Code: [Select]
foreach w in windowList
        Process w Events


If you are going to stuck your code in a while loop that doesnt want to end, at least make sure all important code is in that loop. or better, dont do the loop, and invite the new windows into your main loop code as i said! :)

Hope it helps!

478
Graphics / Best way to achieve parallax scrolling?
« on: September 04, 2011, 02:10:58 am »
I think i know a good solution, lets check on that

Lets call any parallel screen, that needs scrolling at diferent speeds, a layer.
Lets say a layer has a view associated.

When a view is moved, it is moved by a certain amount.
So, a good idea would be to add a speed_factor property to each layer, which multiplies the amount of movement the view suffers.

When your character moves, it will describe a movement along the axes, lets say player_movement variable.

normally, so the main layer view moves along with the player, it moves at the same rate, so it moves by player_movement.

To keep this afirmation true, the main layer speed_factor would be 1. This way the main layer view would follow the player exactly.

Now lets say a background layer should never move. Just assign it a speed_factor of 0, it never moves a inch.

And now just play with that speed_factor for anything in-between static and following the player.

This approach is so simple and effective that you should even achieve dynamic parallax scrolling easily, changing this value acording to your own algorithm. All you need is actually speed_factor and player_movement

You could even compute the speed_factor acordingly to the layer width, so when the main layer is on the end, all the others are too :)

Tell me what you think, if it is not clear, tell me too :)

479
Network / GetLocalAddress doesnt seem correct
« on: September 03, 2011, 01:22:57 pm »
Windows 7 32bit !

I have a really simple ISP service through ADSL. I own a DLink wireless router, to which the laptops in my house connect. My computer connects directly via RJ-45 cable.

My computer and the laptops work fine as a LAN, even allowing file sharing etc.

Thanks

480
Network / GetLocalAddress doesnt seem correct
« on: September 03, 2011, 12:11:02 am »
When i do this:

sf::IpAddress::GetLocalAddress().ToString();

I get 127.0.0.1, i was expecting my LAN address 192.168.10.2.

Any other way to get it?

Thanks

Pages: 1 ... 30 31 [32] 33 34 ... 40
anything