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

0 Members and 1 Guest are viewing this topic.

Zefk

  • Hero Member
  • *****
  • Posts: 535
  • Just helping Solarus
    • View Profile
    • Zefk Design
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: 535
  • Just helping Solarus
    • View Profile
    • Zefk Design
(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)