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

Pages: [1]
1
General / Re: Problem displaying sprite
« on: February 06, 2020, 08:17:25 pm »
I made the image myself, using Inkscape, I also opened it in GIMP and it looks nice. So, it has to be something in my program. They are the same file with same resolution (67px X 67px) that I can ensure you. Using smooth helped a lot, thank you very much for your help ;)

2
General / Re: Problem displaying sprite
« on: February 06, 2020, 05:34:26 pm »
I'll try thati, but it is weird, because it only happens with some textures, maybe its because of the DPI... But when using an image viewer it doesn't happen, but I'll definitely try that

3
General / Re: Problem displaying sprite
« on: February 06, 2020, 04:02:25 pm »
Ask and you shall receive  ;)

This is where the texture is loaded, those are just strings, and this function executes `loadFromFile` on the texture and saves a reference to it in an hashtable.
Code: [Select]
assets.loadTexture(GM_GRID_MINI, GRID_MINI);
This is where the texture is set to a Sprite (this->grid is a sf::Sprite, and assets is the hashtable)
Code: [Select]
this->grid.setTexture(this->data->assets.getTexture(GM_GRID_MINI));
this->grid.setOrigin(halfWidth, halfHeight); // Half the height and width of the sprite
this->grid.setPosition(x, y); // This is simplified, it is not just x and y, but it works fine

And this is where it is displayed:
Code: [Select]
this->data->window.clear(//COLOR);
this->data->window.draw(this->grid);
this->data->window.display()

I don't know what am I doing wrong

4
General / [SOLVED] Problem displaying sprite
« on: February 04, 2020, 07:02:38 pm »
I'm developing a game with SFML, it is all fine, but the sprites are buggy (some of them).
I noticed that some sprites appear to be wrapping, even though they are the exact same size of the image (I printed the height and width of local bounds to check)

So this is how it should display the image: https://imgur.com/qjfTZyr
And this is how it is displayed: https://imgur.com/8QV9elL

I used basic options: loaded texture, set Sprite texture, set origin and position and then displayed

Is it some kind of bug or am I doing things the wrong way?

Pages: [1]
anything