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

Pages: [1]
1
Graphics / Origins and positions
« on: May 15, 2013, 03:01:30 pm »
Hi. I want to implement SFML-like functionality in my small project, because i cant use SFML/GL directly. So, I have a problem with understanding how 'origins' works. As you know setOrigin() doesn't changes position-property of the object, but changes on-screen position. I had to add realPos field to my base class. And when I calls my setOrigin() realPos changes. Here some examples:
public void setPosition(Vector2i position) {
        this.position = position;
        realPos = Vector2i.add(position, origin);
}
And one of draw methods:
@Override
public void draw(Graphics target) {
        target.drawString(as.getIterator(), realPos.x, realPos.y);
}

2
Graphics / Drawing sprites on screen issue [SOLVED]
« on: July 23, 2012, 08:42:54 pm »
Hello. I have a question: what method i must use to put sprites on screen? I know 3:
  • Draw sprites on texture, and then draw texture on screen
  • Draw by passing main "sf::RenderWindow App" into MyClass::Draw (sf::RenderWindow &App)
  • Inheritance of the sf::Drawable class by MyClass, and drawing it by common way
I have not found the answer on the forum and other websites. Sorry for my english. Thanks.

Pages: [1]
anything