Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: How to draw drawable inside another?  (Read 2064 times)

0 Members and 1 Guest are viewing this topic.

vietanh8286

  • Newbie
  • *
  • Posts: 9
    • Yahoo Instant Messenger - jaguar8286
    • View Profile
    • Email
How to draw drawable inside another?
« on: June 16, 2011, 10:03:33 am »

I am creating a GUI, like a panel. Look image that i want..
How i can do that?
Thanks for your help!!!

Groogy

  • Hero Member
  • *****
  • Posts: 1469
    • MSN Messenger - groogy@groogy.se
    • View Profile
    • http://www.groogy.se
    • Email
How to draw drawable inside another?
« Reply #1 on: June 16, 2011, 10:13:07 am »
If it's a Sprite you can change it's subrect to cut it off.

Though this seems like a missing part in Drawable. Or what do you think Laurent? Add some sort of clipping to Drawable so you can do it with shapes and text easily?
Developer and Maker of rbSFML and Programmer at Paradox Development Studio

vietanh8286

  • Newbie
  • *
  • Posts: 9
    • Yahoo Instant Messenger - jaguar8286
    • View Profile
    • Email
How to draw drawable inside another?
« Reply #2 on: June 16, 2011, 10:34:15 am »
Quote from: "Groogy"
If it's a Sprite you can change it's subrect to cut it off.

Though this seems like a missing part in Drawable. Or what do you think Laurent? Add some sort of clipping to Drawable so you can do it with shapes and text easily?


Oh, i understand. Thank you!
it's difficult for me :(

Groogy

  • Hero Member
  • *****
  • Posts: 1469
    • MSN Messenger - groogy@groogy.se
    • View Profile
    • http://www.groogy.se
    • Email
How to draw drawable inside another?
« Reply #3 on: June 16, 2011, 10:42:23 am »
Quote from: "vietanh8286"
Quote from: "Groogy"
If it's a Sprite you can change it's subrect to cut it off.

Though this seems like a missing part in Drawable. Or what do you think Laurent? Add some sort of clipping to Drawable so you can do it with shapes and text easily?


Oh, i understand. Thank you!
it's difficult for me :(


If you are using SFML2 and feel that something is missing just propose to Laurent that he add it and he'll see if there's a need for it or not and consider to add it.

UPDATE:
I actually just saw this issue which is a planned feature for SFML2 so it might come any day: https://github.com/SFML/SFML/issues/1
Developer and Maker of rbSFML and Programmer at Paradox Development Studio

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32504
    • View Profile
    • SFML's website
    • Email
How to draw drawable inside another?
« Reply #4 on: June 16, 2011, 11:38:05 am »
In SFML 1, the common workaround is to use glScissor.
Laurent Gomila - SFML developer

vietanh8286

  • Newbie
  • *
  • Posts: 9
    • Yahoo Instant Messenger - jaguar8286
    • View Profile
    • Email
How to draw drawable inside another?
« Reply #5 on: June 16, 2011, 11:43:59 am »
Quote from: "Laurent"
In SFML 1, the common workaround is to use glScissor.


I use SFML 2. Have you example to do? Thanks!!! :oops:

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32504
    • View Profile
    • SFML's website
    • Email
How to draw drawable inside another?
« Reply #6 on: June 16, 2011, 11:45:42 am »
With SFML 2 it might still work (search "glScissor" on the forum to know how to use it) until render masks are implemented.
Laurent Gomila - SFML developer

vietanh8286

  • Newbie
  • *
  • Posts: 9
    • Yahoo Instant Messenger - jaguar8286
    • View Profile
    • Email
How to draw drawable inside another?
« Reply #7 on: June 16, 2011, 12:24:35 pm »
i got it  :lol: haha it's amazing!!!

i read this thread that i need. Thanks!!!