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

Pages: [1]
1
Graphics / Re: sf::Sprite question?
« on: June 25, 2015, 12:24:22 am »
Thank you :D I will attempt to do that tomorrow.

2
Graphics / Re: sf::Sprite question?
« on: June 24, 2015, 11:52:32 pm »
Thanks for reply here is as minimal example as i managed to get it, in attachment are required files and cpp. To reproduce just move to position of first npc to the left.

(click to show/hide)

3
Graphics / sf::Sprite question?
« on: June 24, 2015, 10:59:31 pm »
I'm not sure what to google for this problem so it might already be answered, my apologies in advance.

Im drawing lots of tiles, so i draw floor tiles under player/monster (to avoid black square when i move). First floor sprite then on the same position player/monster sprite.
It all works except player sprite disappears when i move onto original enemy position but not original player position like so:
http://imgur.com/a/wnGwV

code for setting sprites is:
            temp.setTexture(holder["grass"]);
                        temp.setPosition(i.second);
                        sprites.push_back(std::make_unique<sf::Sprite>(temp));

                        temp.setTexture(holder["monster"]);
                        temp.setPosition(i.second);
                        sprites.push_back(std::make_unique<sf::Sprite>(temp));
 
Code is exactly the same when drawing player.

I have no idea how to approach fixing that so help :D



4
Graphics / Re: Efficiency question
« on: April 26, 2015, 03:02:31 pm »
Thank you so much :)

5
Graphics / Re: Efficiency question
« on: April 26, 2015, 12:45:59 pm »
Thanks, didn't know that.  But otherwise is this ok way to draw sprites, (i'll also draw only those within game view)? Im drawing around 60, only 5 textures tho, or should i use vertex array for this? :D

6
Graphics / Re: Efficiency question
« on: April 26, 2015, 10:09:54 am »
Thanks for fast reply, i think problem is amount of sprites i draw, ill try to make it work with vertex arrays.

7
Graphics / Efficiency question
« on: April 26, 2015, 12:28:58 am »
So im drawing level to screen, and cpu usage is kinda high i still have a lot of refactoring to do but since im lacking knowledge about sfml, i wonder if drawing part is a problem?
This is my draw function:
(click to show/hide)
This feels ineffiecient, how can i improve it?
Thanks  ;D

8
Graphics / Re: Text drawing problem, characters missing
« on: April 15, 2015, 07:57:49 pm »
Thank you so very much it works like a charm!
I have simple rogulike kinda complete as a console application so i wanted to port it to some sort of gui, sfml looked simplest.

9
Graphics / Text drawing problem, characters missing
« on: April 15, 2015, 07:30:44 pm »
I just started with sfml so i might be doing something stupid.
I'm reading from txt file and and want to print that to screen. But i get this:
(click to show/hide)
instead of this:
(click to show/hide)
its formatted correctly in terminal and i have no idea how to debug.
here is code:
(click to show/hide)
So how to fix that? :P
Thanks!

Pages: [1]
anything