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] 2 3 ... 13
Window / Re: Window not showing anymore
« on: October 25, 2020, 03:13:51 am »
I don't really know why you are trying to use new in that case, but try
sf::RenderWindow g_window(sf::VideoMode(1080, 720), "MyGame");

General / Re: Pathfinding script
« on: October 24, 2020, 03:44:37 pm »
well, you won't find anything as "pathfinding script" for SFML, since it is a library for C++, a language that is not scripted. so, its different from a game engine like Godot or Unity.

to be honest, the backbones of a pathfinding code doesn't need SFML at all. have a look at this: https://www.redblobgames.com/pathfinding/a-star/introduction.html

of course, you'll need some programming knowledge.

Graphics / Re: Loading large textures
« on: October 22, 2020, 01:38:49 am »
so, do you have a minimal code that reproduces the problem?

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?

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?

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.

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);
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?

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

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


General / drawing derived classes
« on: August 30, 2020, 05:15:31 pm »
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{

how can I draw this class using a sf::RenderWindow? if I try, for example
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?

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

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

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

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

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.

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

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.

Pages: [1] 2 3 ... 13