Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package net.jnk.blockles;
- import java.awt.Color;
- import java.awt.Graphics;
- public class backdrop {
- public static double alpha;
- public void calculateAlpha(double currentY){
- int yValue = (int)currentY;
- if (yValue < 20){
- alpha = 0;
- } else {
- alpha = ((yValue - 19) * 2.55);
- }
- if (alpha > 255){
- alpha = 255;
- }
- }
- public void render(Graphics g){
- g.setColor(new Color(66, 66, 66, (int)alpha));
- g.fillRect(0, 0, Component.pixel.width, Component.pixel.height);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement