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.


Topics - phoekz

Pages: [1]
1
Graphics / Partially drawing/hiding a sf::Shape::Line
« on: December 02, 2011, 11:18:06 pm »
Hey

In short, how would I go about partially hiding sf::Shape::Line objects like sprites (setsubrect). The picture below explains my intents.

The map screen is scroll-able so the elements inside this frame are moving and obviously when they reach border of the frame, they will be hidden and not drawn at all.


2
General discussions / Confused about static linking
« on: June 23, 2011, 11:36:41 pm »
I am currently trying to accomplish this wonderful thing called static linking and I have no idea how this is done. I downloaded newest src of SFML 2.0 and ran Cmake with it. Then I ticked STATIC_STD_LIBS and pressed Generate. After that I have no clue how to proceed. Do I have to do something before I build SFML in Visual C++ 2010 and what do I have to do in project itself to enable static linking?

I've been trying something myself like messing with build options and adding SFML_STATIC on preprocessor, but I am still very confused how to get this work properly.

I'd love to hear how you guys do it.

3
General / Game engine design, proper class instances handling
« on: April 12, 2011, 03:38:26 pm »
Hey,

I'm creating basic game from scratch using C++, SFML & Box2D. What I like to know is, how do you properly summon new object (like an instance of a class), how do you store it and how do you delete it from both game and memory?

I have tried having something like ObjectHandler which sub-class Object inherits from. ObjectHandler creates new instances of Object using "new" and adds them immediately to Vector. This obviously works when you add stuff in, but when it comes to destroying them, it starts getting really confusing. Basically I have no way of controlling those objects ever again if I just go like "Object * Box = new Object" all the time, so I'm looking for better solution.

Thank you in advance :).

4
Window / [SOLVED]Trying to create HUD on View (more elegant solution)
« on: April 08, 2011, 09:39:01 am »
What I'm trying to do is simply have text on View so it will move when the View moves as well. I have accomplished by setting the text's position relative to View's center position, like this:

Code: [Select]
CountFPS.Update();
float x = View.GetCenter().x - 510;
float y = View.GetCenter().y - 388;
Text.SetPosition(x, y);
Text.SetText(CountFPS.GetFPS());
Screen->Draw(Text);


It is quite hacky in my opinion and requires lot of pixel perfection to get it right, also when I want more elements to the HUD, it will be quite a mess. Is there some more cleaner/elegant way to do this?

Thanks in advance.

Pages: [1]