All Downloads are FREE. Search and download functionalities are using the official Maven repository.

mmb.engine.texture.ConstSolidIcon Maven / Gradle / Ivy

Go to download

Dependency for the MultiMachineBuilder, a voxel game about building an industrial empire in a finite world. THIS RELEASE IS NOT PLAYABLE. To play the game, donwload from >ITCH.IO LINK HERE< or >GH releases link here<

There is a newer version: 0.6
Show newest version
/**
 * 
 */
package mmb.engine.texture;

import java.awt.Color;
import java.awt.Component;
import java.awt.Graphics;

import javax.swing.Icon;

import mmb.Nil;

/**
 * @author oskar
 *
 */
public class ConstSolidIcon implements Icon {
	private final int w, h;
	public final Color c;

	public ConstSolidIcon(int w, int h, Color c) {
		super();
		this.w = w;
		this.h = h;
		this.c = c;
	}

	@Override
	public int getIconHeight() {
		return h;
	}

	@Override
	public int getIconWidth() {
		return w;
	}

	@Override
	public void paintIcon(@Nil Component cm, Graphics g, int x, int y) {
		g.setColor(c);
		g.fillRect(x, y, w, h);
	}

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy