Author Topic: Question on "blend"  (Read 905 times)

Zefk

  • Hero Member
  • *****
  • Posts: 536
  • Just helping Solarus
    • View Profile
    • Zelzec
Question on "blend"
« on: December 22, 2016, 12:05:41 am »
I am a bit confused. The mode "blend" looks no different than any other image.


Code: ( lua) [Select]
   
    --This drawable object is alpha-blended onto the destination surface
    blend_red_img:draw(screen,100,200)
    blend_red_img:set_blend_mode("blend")

    blend_green_img:draw(screen,100,200)
    blend_green_img:set_blend_mode("blend")

    blend_blue_img:draw(screen,100,200)
    blend_blue_img:set_blend_mode("blend")

It looks like this: (Unless the alpha is at 255)



I thought it was suppose to be like this:

Zefk

  • Hero Member
  • *****
  • Posts: 536
  • Just helping Solarus
    • View Profile
    • Zelzec
(SOLVED) Question on "blend"
« Reply #1 on: December 22, 2016, 04:59:33 am »
I see....I fingered it out. It blends on the surface and I was trying to blend them on the screen. Here is a sample.

Code: ( lua) [Select]
surface_img:draw(screen)
    --fill suface with a orange color
    surface_img:fill_color({245,68,0})
   
   --"blend" blend mode.
    blend_test_img:draw(screen)
    blend_red_img:draw(surface_img,100,200)
    blend_red_img:set_blend_mode("blend")

    blend_green_img:draw(blend_test_img,100,200)
    blend_green_img:set_blend_mode("blend")

    blend_blue_img:draw(blend_test_img,100,200)
    blend_blue_img:set_blend_mode("blend")

     surface_img:set_opacity(80)