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

Pages: 1 ... 11 12 [13] 14 15 ... 25
181
Graphics / Re: Loading large textures
« on: October 22, 2020, 01:38:49 am »
so, do you have a minimal code that reproduces the problem?

182
Graphics / Re: Loading large textures
« on: October 21, 2020, 01:00:41 pm »
I don't know if it is still true nowadays, but it is said that textures sized by the power of 2 are better handled by the graphics card: 2x2, 4x4, 8x8, 16x16, 32x32, 64x64, 128x128, 256x256, 512x512, 1024x1024, 2048x2048, 4096x4096 etc...
do you really need to use threads for that? how are you doing it? and have you tried not using it?

183
Window / Re: How to create a maximized window?
« on: October 13, 2020, 03:52:03 pm »
I don't get it. do you want it to be fullscreen OR maximized?

184
Graphics / Re: Delete tile SFML + TinyXML
« on: October 09, 2020, 01:38:30 pm »
i have no idea how you are creating your tiles (you should post a minimal example), but if you just want to make it transparent, the general idea would be to set tile_sprite.setColor(sf::Color::Transparent); if our tiles are based on sprites, or select each vertex of the specified tile and set vertex.color = sf::Color::Transparent if your tilemap is based on vertexarrays.

185
General / Re: Linker error: sf::Color
« on: October 03, 2020, 02:38:47 pm »
the code has no compile errors, altough you are creating a new circle every frame. just move this
sf::CircleShape ksztalt(std::sin(stoper.getElapsedTime().asSeconds()) * okno.getSize().y / 8 + okno.getSize().y / 4);
      ksztalt.setOrigin(sf::Vector2f(ksztalt.getRadius(), ksztalt.getRadius()));
      ksztalt.setPosition(okno.getSize().x / 2.0f, okno.getSize().y / 2.0f);
      ksztalt.setFillColor(sf::Color::Yellow);
to before this:
while (okno.isOpen())
 

so you won't create a new circle every loop.


but thats probably not what is causing your error. your description does not help much yet. what SO are you using, what version of SFML did you download, and what IDE do you use?

186
it seems the font is not in the same place as your cpp files. try changing "arial.ttf" for "Resources/arial.ttf"

187
General / Re: drawing derived classes
« on: September 01, 2020, 01:58:21 am »
my idea was to make derived classes that could handle easily texts, sprites, and some more atributes and methods. i'll just put text and sprite as public access members, then.
(but it is kinda ugly)  :-X

thanks!

188
General / drawing derived classes
« on: August 30, 2020, 05:15:31 pm »
hi
i believe this is a newbie issue related to SFML structure and C++
if I have a class derived from two drawables, like this:
class Board : public sf::Text, public sf::Sprite{
    ///etc;
};

how can I draw this class using a sf::RenderWindow? if I try, for example
window.draw(board.Sprite);
I get an error saying
 invalid use of ‘sf::Sprite::Sprite’
but how do I make the window draw the sprite and then the text? is it mandatory that i override the draw function in Board class, pass a window reference, and then draw each one of the drawables from inside the class?
thanks!

189
Graphics / Re: Sprite is showing outside texture rect
« on: August 13, 2020, 11:45:30 pm »
did you set texture smooth to be true?

190
SFML projects / Re: Screenshot Thread
« on: August 09, 2020, 04:24:13 pm »
finally I have something a little prettier to show  ;D
becoming something between sim city and gangsters 2, I guess




http://www.youtube.com/watch?v=vY-htTALz-8
first, showing map with no filters
second, showing map owner of each building (there is only one for now, blue)
and then showing each buildings value. the greener ones have higher value, and tend to be closest to the center

191
Window / Re: RenderWindow Screen
« on: August 09, 2020, 01:17:55 pm »
there is not. what are you trying to do?

192
since I have no idea how you structured the rest of your code, i'm going to just suggest you to make a bool inside your class named "m_animation_playing" or something like that. when your character dies, you wait for the deah animation to finish and then turn the bool off. while it is off, you dont change the EntityRect position.

193
General / Re: [SOLVED] need a better collision idea
« on: August 02, 2020, 07:01:44 pm »
hi, I just wanted to show the results here. not optimized yet, but its beautiful

http://www.youtube.com/watch?v=JkBzk3SzpEM
Quote
n is the current tile where the mouse is
id is color id of that tile (always n + 1)
r, g and b are the corresponding colors of that id
x and y are the tile position on the map
m_stamp_sprite are the positions of the sprite's vertices (x and y)
identified building is... well, the building identified by the color
also, i got rid of the rendertexture.i simply draw the colorized tiles to screen, process what is needed, clear the screen and draw what will be visible to the user.

194
System / Re: Limitations of repeated key events
« on: August 02, 2020, 02:10:06 pm »
ops, you're right. it's just one event checked at a time.
but as Laurent said, I tested it in a text editor and it gives the exact same results  :(

195
System / Re: Limitations of repeated key events
« on: August 01, 2020, 10:26:21 pm »
no, the problem is the line
else if (event.key.code == sf::Keyboard::B)
by using "else if", this code is going to be executed only if A is NOT pressed. if you want both to be checked, just remove the "else"

Pages: 1 ... 11 12 [13] 14 15 ... 25