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.


Topics - Demir

Pages: [1]
1
SFML wiki / Android example can not close on Escape
« on: February 06, 2016, 03:08:46 pm »
Hello,

I try to run android example through wiki "Tutorial: Building SFML for Android".
As was expected it worked.

I added Escape key release checking to close via Back button on the tablet.
if (event.type == sf::Event::KeyReleased)
{
  if (event.key.code == sf::Keyboard::Escape)
  window.close();
}
 
It can not close properly.
Any idea ? What can I do ?

Thanks

Edit:
I noticed same question at this link :(
http://en.sfml-dev.org/forums/index.php?PHPSESSID=ot7h2v1oj9hmn1qop9q78i4s03&topic=19145.msg141108#msg141108

2
Graphics / how to use RenderTexture properly (off-screen drawing) ?
« on: February 17, 2014, 10:46:03 am »
Hello,

I'm trying to use off-screen drawing (in tutorial section "Drawing 2D stuff")

if i don't use set origin and scale it doesn't display properly.

What am I doing wrong?

   
sprite.setOrigin(0, 400);
sprite.scale(1, -1);
 


#include <SFML/Graphics.hpp>
#include <SFML/Window.hpp>

int main()
{
    sf::RenderWindow window(sf::VideoMode(300, 400), "Render Texture");

    sf::RenderTexture rt;
    sf::Sprite sprite;

    rt.create(300, 400);
    //sprite.setOrigin(0, 400);
    //sprite.scale(1, -1);

    sf::RectangleShape rect;
    rect.setPosition(10, 20);
    rect.setSize(sf::Vector2f(50, 100));
    rect.setFillColor(sf::Color(0, 255, 0));
    rt.draw(rect);

    sprite.setTexture(rt.getTexture());
    sprite.setPosition(0, 0);

    while (window.isOpen())
    {
        sf::Event event;
        while (window.pollEvent(event))
        {
            if (event.type == sf::Event::Closed)
                window.close();
        }
        window.clear(sf::Color::Black);
        window.draw(sprite);
        window.display();
    }

    return 0;
}
 

3
SFML website / Where are new version changes..."What's new"
« on: August 01, 2013, 12:28:24 pm »
Hello,

I can not see updates , changes info about 2.1. new version.

4
Graphics / ConvexShape and its getPosition
« on: May 28, 2013, 10:23:05 am »
Hello

I'm trying to make this:

draw(convexshape with 4 points)
getBounds
getPosition
draw(rectangle) //frame arround convex sahpe
 

If convexshape's first coordinate is different from "0" then getPosition returns (pos - firstCoord).

is it normal behaviour ?

rect.setPosition(shape.getPosition());


[/code]


#include <SFML/Graphics.hpp>

int main ()
{
    sf::ConvexShape shape(4);
    shape.setFillColor(sf::Color::Red);

    sf::RectangleShape rect;
    rect.setFillColor(sf::Color::Green);

    shape.setPoint(0, sf::Vector2f(40,50));
    //shape.setPoint(0, sf::Vector2f(0,0));
    shape.setPoint(1, sf::Vector2f(140,60));
    shape.setPoint(2, sf::Vector2f(150,250));
    shape.setPoint(3, sf::Vector2f(30,240));

    shape.setPosition(200, 200);

    rect.setSize(sf::Vector2f(shape.getGlobalBounds().width, shape.getGlobalBounds().height));
    rect.setPosition(shape.getPosition());

    sf::RenderWindow window(sf::VideoMode(800, 600), "ConvexShape");
    sf::Event event;

    while (window.isOpen()) {
        while (window.pollEvent(event)) {
            switch (event.type) {
            case sf::Event::Closed:
                window.close();
                break;
            case sf::Event::KeyPressed:
                window.close();
                break;
            }
        }

        window.clear();
        window.draw(rect);
        window.draw(shape);
        window.display();
    }
}

5
Hello

I need to display data transfer in a progress bar while data sending/recieving with Ftp/Http.
It is not necessary except big files.

There is a loop in "Ftp::DataChannel::receive"...
But "Ftp::DataChannel::send" method sends data completely at one time.
May be TcpSocket the private member of Ftp  is responsible for this.

My thoughts may tottally be wrong :)


Demir

Pages: [1]