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

Pages: [1]
1
Graphics / q: how to use the sf:view correctly?
« on: June 01, 2015, 04:46:40 pm »
I defined the size of the window as (800,650) and i have image of (1439,659).
I want to see just part of the image so that i can move a little to the sides and still be on the image.
What that happen is that instead of showing just the part of the image it's squeezing almost the whole image into the screen.

code:
sf::View view(sf::Vector2f(middle_x, middle_y), sf::Vector2f(window.getSize().x, window.getSize().y));
view.setSize(WINDOW_X_LENGTH, WINDOW_Y_LENGTH - 50);
 

when middle_x and middle_y is the center of the image.

2
Graphics / Re: sf::CreateMaskFromColor doesn't work properly?
« on: May 25, 2015, 04:53:22 pm »
thx man
I didn't know about that option of deleting parts in the images so that they become transperting.
Did that, some color play, smooth on, and the result is good.


3
Graphics / sf::CreateMaskFromColor doesn't work properly?
« on: May 25, 2015, 03:39:11 pm »
hi
i'm trying to build little shooting game. so, i'm trying to adding a scope/sight.
I want to remove the white background so the target can be seen.
I'm using this simple code:
_sight_object_image.loadFromFile("sight.png");
        _sight_object_image.createMaskFromColor(sf::Color::White);
        _sight_object_texture.loadFromImage(_sight_object_image);
        _sight_Object_sprite.setTexture(_sight_object_texture);

But what happend is that in all the 'round' place, the function doesn't seem to work properly..
Any ideas???




Pages: [1]
anything