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

Pages: [1]
1
Java / Re: JSFML using github SFML
« on: July 19, 2013, 11:32:25 pm »
You can make a patch and try to apply it to a jsfml sources. But be attentive with JNI headers.
I suppose it will work.

2
Graphics / Re: Camera Boundary
« on: July 19, 2013, 11:21:09 pm »
I used a Camera class, that implements certain behaviour. This class can have got a field for world's size, that sets when level is loading. So, camera can make decision: to move or not.

3
Graphics / Re: SFML best objekt for drawing
« on: July 19, 2013, 11:11:54 pm »
In this case, no matters what language to use. I just want to show how can be draw method implemented. You know that better than me, so you can show it in c++.

4
Graphics / Re: SFML best objekt for drawing
« on: July 19, 2013, 10:03:43 pm »
Just make your GameObject deriving from sf::Drawable, and implement draw method. Somethin like this (dont afraid, it is java):
@Override
public void draw(RenderTarget target, RenderStates states) {
    target.draw(sprite, states);
    drawBoundingBox(target, states);
}

5
Graphics / Re: Origins and positions
« on: May 15, 2013, 07:06:10 pm »
Yes, I know it. But I need technical details. For example, how I can implement drawning of any object:
target.drawSome(getOrigin() + getPosition(), params...);
Or
screenPos = getOrigin() + getPosition(); //In superclass
...
target.drawSome(realPos, params...); // In derivative class. getRealPos is protected field ob superclass

6
General discussions / Re: Please update ubuntu package libsfml-dev
« on: May 15, 2013, 03:21:27 pm »
Anyway you can build SFML from source. There is some guides on sfml's website.

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

8
Graphics / Re: Can you draw a shaped sprite?
« on: July 24, 2012, 05:06:31 pm »
1. Launch gimp
2. Create new file
3. Layer -> Mask -> Add layer mask -> "Black (full transparency)" -> OK
4. Layer -> Aply layer mask
5. Draw your image and save it with .png.

9
Graphics / Re: Drawing sprites on screen issue
« on: July 24, 2012, 12:05:50 pm »
Thanks. Now I can start refactoring.
</tread>

10
Graphics / Re: Drawing sprites on screen issue
« on: July 24, 2012, 09:02:29 am »
>Are you asking for the 'best' solution?
Yes. This is exactly what I was looking for.

11
Graphics / Re: Drawing sprites on screen issue
« on: July 23, 2012, 09:59:51 pm »
Ok. For example, I want to draw grid and I want to use function to do this job. At the first time I use this:
void draw_grid (sf::RenderWindow &App)
{
    /*Some code*/
        App.Draw (line);
    /*...*/
}
 
Another 2 methods I descibed in my first post.

12
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]