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

Author Topic: Two Questions about graphics.  (Read 1479 times)

0 Members and 1 Guest are viewing this topic.

felipehen

  • Newbie
  • *
  • Posts: 4
    • View Profile
Two Questions about graphics.
« on: November 24, 2010, 06:51:14 am »
Hello :D
I came here to see if anyone knows how to do the following:

Make a transition from screen, based on an image of shades of black and white (who already used rpg maker should have an idea what I'm talking about)

And also wanted to know if there is any way to select a rect in a sprite, and returns it as a sprite.

Thanks in advance.
And sorry for using bad English (I used google translator to write this: oops:)

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32504
    • View Profile
    • SFML's website
    • Email
Two Questions about graphics.
« Reply #1 on: November 24, 2010, 08:15:40 am »
Quote
Make a transition from screen, based on an image of shades of black and white

I think it's ok, but you should maybe show an example so that we know exactly what you're talking about.

Quote
And also wanted to know if there is any way to select a rect in a sprite, and returns it as a sprite.

Simply copy the sprite, and assign the new one a smaller subrect.
Laurent Gomila - SFML developer

felipehen

  • Newbie
  • *
  • Posts: 4
    • View Profile
Two Questions about graphics.
« Reply #2 on: November 24, 2010, 09:34:47 pm »
Thanks for the reply.
Quote
imply copy the sprite, and assign the new one a smaller subrect.

You can show a code example? (sorry i am newbie in sfml)


On the transition I made an example below:
The following image is one that produces the effect:

The output is more or less like the animation:

I think it's basically read the more darker colors, and store the current screen and next in a two sprites and lowering the opacity of the pixels on current screen sprite to show next screen.
Well I hope you have understood :(

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32504
    • View Profile
    • SFML's website
    • Email
Two Questions about graphics.
« Reply #3 on: November 24, 2010, 11:13:15 pm »
Quote
You can show a code example? (sorry i am newbie in sfml)

Code: [Select]
sf::Sprite newSprite = oldSprite;
newSprite.SetSubRect(...);


Quote
I think it's basically read the more darker colors, and store the current screen and next in a two sprites and lowering the opacity of the pixels on current screen sprite to show next screen.
Well I hope you have understood

Nop :lol:
But don't hesitate to play with transparency (the 4th component of sf::Color), as well as scale, etc. to create dynamic effects/transitions. You can also play with shaders (sf::PostFx) for more complex per-pixel effects.
Laurent Gomila - SFML developer

felipehen

  • Newbie
  • *
  • Posts: 4
    • View Profile
Two Questions about graphics.
« Reply #4 on: November 25, 2010, 01:46:05 am »
Thank you.
But my pc dont support GLSL :(
I try make a code, and if i have success i post the code here.
bye