Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function bmpTest() {
- var w = 10;
- var h = 10;
- var bmpMap = new BitmapData(w, h);
- bmpMap.perlinNoise(w, h, 8, Std.random(0xffffff), false, true, 7, true);
- for (y in 0...h) {
- for (x in 0...w) {
- var val = bmpMap.getPixel32(x, y);
- Lib.trace("----");
- Lib.trace(StringTools.hex(val));
- Lib.trace(StringTools.hex(toRGB(val).b));
- Lib.trace(val);
- Lib.trace(toRGB(val).b);
- }
- }
- }
- function toRGB(int:Int) : Dynamic<Int> {
- return {
- r: (int >>> 24)&0xff ,
- g: (int >>> 16)&0xff ,
- b: (int >>> 8)&0xff,
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment