RMRK is retiring.
Registration is disabled. The site will remain online, but eventually become a read-only archive. More information.

RMRK.net has nothing to do with Blockchains, Cryptocurrency or NFTs. We have been around since the early 2000s, but there is a new group using the RMRK name that deals with those things. We have nothing to do with them.
NFTs are a scam, and if somebody is trying to persuade you to buy or invest in crypto/blockchain/NFT content, please turn them down and save your money. See this video for more information.
Bitmap Gradient for Bars

0 Members and 2 Guests are viewing this topic.

*
Full Metal Mod - He will pillage your women!
Rep:
Level 93
The RGSS Dude
Using a method I found on Dubealex to create a gradient, I created a method that allows you to create a gradient bar using 1 or more colors.

If using 1 color, it will obviously be a solid color.

But if you use 2 or more, it will automaticly calculate the width and gradient for each section creating a gradient using all the colors you supplied in order.

Code: [Select]
class Bitmap
def grade(x,y,width,height,start,finish)
for i in 0..width
r = start.red * (width - i) / width + finish.red * i / width
g = start.green * (width - i) / width + finish.green * i / width
b = start.blue * (width - i) / width + finish.blue * i / width
a = start.alpha * (width - i) / width + finish.alpha * i / width
fill_rect(x + i,y,1,height,Color.new(r, g, b, a))
end
end
def draw_gradient(x,y,width,height,colors)
gradient_width = ((width * 1.0) / (colors.size - 1))
    if colors.size == 1
      grade(x,y,width,height,colors[0],colors[0])
      return
    end
for i in 0..(colors.size - 2)
x_var = (x + (i * gradient_width))
grade(x_var,y,gradient_width,height,colors[i],colors[i + 1])
end
end
end

I created a simple hp bar using the above script as an example -

[code]class Window_Base < Window
« Last Edit: April 06, 2006, 12:50:14 AM by Tsunokiette »
"The wonderful thing about Tiggers
Is Tiggers are wonderful things
Their tops are made out of rubber
Their bottoms are made out of springs

They’re bouncy, trouncy, flouncy, pouncy
Fun, fun, fun, fun, fun!
But the most wonderful thing about Tiggers
Is I’m the only one, I’m the only one."

********
EXA
Rep:
Level 92
Pikachu on a toilet
Project of the Month winner for April 2007
Lol, remembers me of the scripts in my game.
:mrgreen: Shaft: "Of course it does. The gradient addition in your game IS Dubealex
Get King of Booze for Android, for iOS, for OUYA or for Windows!
Visit our website.
You can also love/hate us on Facebook or the game itself.


Get DropBox, the best free file syncing service there is!

*
Full Metal Mod - He will pillage your women!
Rep:
Level 93
The RGSS Dude
lol, to tell you the truth, it's taking me so long to work on the other scripts I'm working on, (I keep changing them), that I felt like I wasn't really producing anything.

Plus I wanted to feel special again lol, even if it was me simply updating a formula somebody else created.
"The wonderful thing about Tiggers
Is Tiggers are wonderful things
Their tops are made out of rubber
Their bottoms are made out of springs

They’re bouncy, trouncy, flouncy, pouncy
Fun, fun, fun, fun, fun!
But the most wonderful thing about Tiggers
Is I’m the only one, I’m the only one."

********
EXA
Rep:
Level 92
Pikachu on a toilet
Project of the Month winner for April 2007
Get King of Booze for Android, for iOS, for OUYA or for Windows!
Visit our website.
You can also love/hate us on Facebook or the game itself.


Get DropBox, the best free file syncing service there is!

**
Rep: +0/-0Level 88
Righteous Crusaders
According to your siggy you're an SDK user, right?  So is this SDK or non-SDK?

*
? ? ? ? ? ? ? ? ? The nice kind of alien~
Rep:
Level 92
Martian - Occasionally kind
It works without SDK.

**
Rep: +0/-0Level 88
Righteous Crusaders
Oh, okay.  Awesome job, Tsunokiette.

*
Rep:
Level 97
Definitely better than Hitler.
2014 Best IRC Chatterbox2014 Best Musician2013 King of RMRK2013 Best Musician2013 Best Use of Avatar and Signature Space2013 Funniest MemberFor the great victory in the Breakfast War.2012 Best Username2012 Best MusicianFor frequent good quality Wiki writing [citation needed]2011 Funniest Member2011 Best MusicianMost entertaining member on the IRC2010 Most Missed Member
Moved to database to make Tsuno feel special.  :-D
:tinysmile:

********
Rep:
Level 96
2011 Most Missed Member2010 Zero To Hero
This is exactly what I need for an event I am making. Where does it get inserted into the script database?

*
Rep: +0/-0Level 10
RMRK Junior
Severely una.rymh.rmrk.net.gqt.um anyone retransfusion kamagra jelly brahmi vardenafil 20 mg online finpecia finpecia for sale cialis vs viagra imuran generic rumalaya forte for sale price of lioresal callipers adenoma <a href="http://vintagepowderpuff.com/kamagra-jelly/">cheap kamagra</a> <a href="http://disasterlesskerala.org/brahmi/">brahmi without dr prescription</a> <a href="http://gaiaenergysystems.com/generic-levitra-20mg/">generic vardenafil 20mg</a> <a href="http://sbmitsu.com/finpecia/">finpecia without dr prescription</a> <a href="http://robots2doss.org/tadalafil-20mg-lowest-price/">tadalafil 20mg lowest price</a> <a href="http://myonlineslambook.com/imuran/">imuran without dr prescription</a> <a href="http://telugustoday.com/rumalaya/">generic rumalaya forte</a> rumalaya forte generic <a href="http://dallasmarketingservices.com/lioresal/">lioresal for sale</a> susceptibility coarser http://vintagepowderpuff.com/kamagra-jelly/ kamagra for sale kamagra oral jelly canada http://disasterlesskerala.org/brahmi/ brahmi http://gaiaenergysystems.com/generic-levitra-20mg/ levitra http://sbmitsu.com/finpecia/ finpecia http://robots2doss.org/tadalafil-20mg-lowest-price/ generic cialis http://myonlineslambook.com/imuran/ cheapest imuran http://telugustoday.com/rumalaya/ cheapest rumalaya liniment http://dallasmarketingservices.com/lioresal/ cheapest lioresal projected certification deposition.

*
Rep: +0/-0Level 8
RMRK Junior
City-dwellers kmy.jpxz.rmrk.net.dsk.ka progresses, occupancy buy prednisone online cipro naltrexone for sale naltrexone no prescription cialis prednisone loyalty narrower <a href="http://wellnowuc.com/buy-prednisone-online/">prednisone</a> <a href="http://ralstoncommunity.org/cipro/">cipro</a> <a href="http://dallasmarketingservices.com/naltrexone/">naltrexone no prescription</a> <a href="http://casatheodoro.com/cialis-5-mg/">cialis 10mg</a> <a href="http://wellnowuc.com/buying-prednisone-on-the-interent/">buying prednisone on the interent</a> socially http://wellnowuc.com/buy-prednisone-online/ prednisone http://ralstoncommunity.org/cipro/ ciprofloxacin hcl 500 mg antibiotics http://dallasmarketingservices.com/naltrexone/ naltrexone http://casatheodoro.com/cialis-5-mg/ cialis online http://wellnowuc.com/buying-prednisone-on-the-interent/ prednisone conduct remediable airway, hurts.