This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var bd = Assets.getBitmapData("path/to/image.png"); | |
var a : Array<Array<BitmapData>> = []; | |
var xCount = 5; // berapa banyak tile horizontal | |
var yCount = 5; // berapa banyak tile vertikal | |
var tileWidth = Std.int(bd.width/xCount); // dibulatkan kebawah | |
var tileHeight = Std.int(bd.height/yCount); // dibulatkan kebawah |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var bd = Assets.getBitmapData("img/sumachan.png"); | |
var temp:BitmapData = new BitmapData(300, 300, true, 0); | |
temp.copyPixels(bd, new Rectangle(0, 0, 300, 300), new Point(0, 0)); | |
var data:Data = Tools.build32ARGB(temp.width, temp.height, Bytes.ofData(temp.getPixels(temp.rect))); | |
var bo:BytesOutput = new BytesOutput(); | |
var writer:Writer = new Writer(bo); | |
writer.write(data); | |
var byteArray:ByteArray = bo.getBytes().getData(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
http://try.haxe.org/#7dB24 | |
http://en.wikipedia.org/wiki/Linear_congruential_generator | |
*/ | |
class Test { | |
// define the multiplier | |
static var a : Int = 1140671485; | |
// define the increment | |
static var c : Int = 12820163; | |
// define the modulo |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import flash.display.Sprite; | |
import flash.Lib; | |
class Test { | |
static function linear(t:Float) : Float return t; | |
static function quad(t:Float) : Float return t * t; | |
static function cubic(t:Float) : Float return t * t * t; | |
static function quart(t:Float) : Float return t * t * t * t; | |
static function quint(t:Float) : Float return t * t * t * t * t; | |
static function poly(t:Float, p:Float=2.0) : Float return Math.pow(t, p); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
title : The End of It | |
--- | |
Hmmm... sorry telat berkabar lagi... | |
Dan sekarang banyak pertanyaan ke aku kenapa aku menghapus beberapa blog post aku. | |
Dan inilah jawabannya... | |
Jeng jeng jeng... | |
#### Goal Yang Tidak Tercapai #### |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name | value | |
---|---|---|
Locke | 4 | |
Reyes | 8 | |
Ford | 15 | |
Jarrah | 16 | |
Shephard | 23 | |
Kwon | 42 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#define TAU 6.2831853072 | |
uniform vec2 origin = vec2(0.0, 0.0); | |
uniform float direction = 0.0; | |
uniform float amplitude = 10.0; | |
uniform float length = 10.0; | |
uniform float evolution = 0.0; | |
vec2 distanceDirection(vec2 pos) { | |
float angle = direction * TAU; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
OFX Invert Example plugin, a plugin that illustrates the use of the OFX Support library. | |
Copyright (C) 2007 The Open Effects Association Ltd | |
Author Bruno Nicoletti [email protected] | |
Redistribution and use in source and binary forms, with or without | |
modification, are permitted provided that the following conditions are met: | |
* Redistributions of source code must retain the above copyright notice, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Save this file with a jsx extension and place in your | |
Illustrator/Presets/en_US/Scripts folder. You can then | |
access it from the File > Scripts menu */ | |
var decimalPlaces = 3; | |
function calculateArea (obj) { | |
if (obj.typename == "PathItem") { | |
return obj.area; // could be negative | |
} else if (obj.typename == "CompoundPathItem") { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export function parseOrigin(transformOrigin) { | |
return transformOrigin.split(" ").map(parseFloat); | |
} | |
export function getElementMatrix(element) { | |
const matrix = new DOMMatrix(); | |
let current = element; | |
while (current) { | |
const computedStyle = window.getComputedStyle(current); | |
const origin = parseOrigin(computedStyle.transformOrigin); |
OlderNewer