Please login or register.

Login with username, password and session length
Advanced search  

News:

For WME related articles and tutorials visit WME Resource Center.

Author Topic: Change Brightness With MakeHSL  (Read 3455 times)

0 Members and 1 Guest are viewing this topic.

serdar

  • Lurker
  • *
  • Karma: 0
  • Offline Offline
  • Gender: Male
  • Posts: 11
    • View Profile
    • serdar
Change Brightness With MakeHSL
« on: August 21, 2010, 02:03:33 PM »

I want to make a photo machine flash effect.
I thought, I can change the Lightness of background with the MakeHSL method to simulate the photo machine flash.

I'm using this code block...

Code: [Select]
var bck = Scene.GetNode("background");

on "LeftClick"
{
//returns 0
var H = GetHValue(bck.AlphaColor);
//returns 0
var S = GetSValue(bck.AlphaColor);
//returns 0
var L = GetLValue(bck.AlphaColor);
 
// on paint.net saturation default is 100 and
// if i set Lightness to 30 it changes the brightness
// i wanted to simulate it with this code
bck.AlphaColor = MakeHSL(H, 100, 30);   
// but this makes the screen completely dark...
 
Game.ScreenshotEx(Game.SaveDirectory + "\test.bmp");

bck.AlphaColor = MakeHSL(H, 100, L);   
}

this changes the brightness but not similar to flash effect
Why this AlphaColor property needs for loop?
Code: [Select]
for(var i=5; i<25; i=i+2)
{
bck.AlphaColor = MakeHSL(H, S, i*20);   
Sleep(2);
}



Can you guide me to simulate photo machine flash? Probably I'm on the wrong way...

metamorphium

  • Global Moderator
  • Addicted to WME forum
  • *
  • Karma: 12
  • Offline Offline
  • Gender: Male
  • Posts: 1511
  • Vampires!
    • View Profile
    • CBE  software s.r.o.
Re: Change Brightness With MakeHSL
« Reply #1 on: August 21, 2010, 03:09:29 PM »

why are you changing only transparency channel?
Logged
J.U.L.I.A. Enhanced Edition, Vampires!, J.U.L.I.A., J.U.L.I.A. Untold, Ghost in the Sheet

serdar

  • Lurker
  • *
  • Karma: 0
  • Offline Offline
  • Gender: Male
  • Posts: 11
    • View Profile
    • serdar
Re: Change Brightness With MakeHSL
« Reply #2 on: August 21, 2010, 03:25:46 PM »

i do not know what other things to do...

on paint.net
if i just change the lightness
it is ok for me

i tried to do the same on wintermute.

metamorphium

  • Global Moderator
  • Addicted to WME forum
  • *
  • Karma: 12
  • Offline Offline
  • Gender: Male
  • Posts: 1511
  • Vampires!
    • View Profile
    • CBE  software s.r.o.
Re: Change Brightness With MakeHSL
« Reply #3 on: August 21, 2010, 06:06:33 PM »

I don't think you can do it this way. What I'd do is probably less elegant, but I'd use white bitmap and quickly animate it's transparency from 0 to 255 to achieve the same effect

here you'd use something like this:

for (var a=0;a<255;a=a+15)
{
   back.AlphaColor = MakeRGBA(255,255,255,a);
   Sleep(30);
}

Or you can use Scene.FadeOut(60,255,255,255,255);
Logged
J.U.L.I.A. Enhanced Edition, Vampires!, J.U.L.I.A., J.U.L.I.A. Untold, Ghost in the Sheet
 

Page created in 0.033 seconds with 20 queries.