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
/** | |
* Возвращает индекс ячейки | |
* @param index порядковый индекс | |
* @param length длина строки | |
* @return | |
* | |
*/ | |
public function cellIndex(index:uint, length:uint):Object { | |
var r:uint = Math.floor(index / length); | |
var c:uint = index - (r * length); |
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
package ru.gotoandstop.display { | |
import flash.display.DisplayObject; | |
import flash.display.Sprite; | |
public function createSpriteWithCentredContent(content:DisplayObject):Sprite { | |
var s:Sprite = new Sprite(); | |
content.x = -int(content.width / 2); | |
content.y = -int(content.height / 2); | |
s.addChild(content); | |
return s; |
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
package ru.gotoandstop.bytes{ | |
import flash.utils.ByteArray; | |
/** | |
* @author: Roman Timashev (roman@tmshv.ru) | |
**/ | |
public class ByteArrayUtil{ | |
private static var __bitPosition:uint; | |
public function ByteArrayUtil(){ |
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
package ru.gotoandstop.display{ | |
import flash.display.Bitmap; | |
import flash.display.BitmapData; | |
import flash.display.BlendMode; | |
import flash.display.IBitmapDrawable; | |
import flash.geom.ColorTransform; | |
import flash.geom.Matrix; | |
import flash.geom.Rectangle; | |
/** |
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 type of point relativly line | |
* point: {x:[number], y:[number]} | |
* line: | |
{ | |
first:{x:[number], y:[number]}, | |
second:{x:[number], y:[number]} | |
} | |
*/ | |
function classify(point, line) { |
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
/** | |
* return coordinate of crossing two lines defined by {x1; y1}, {x2; y2} | |
* @param l1 | |
* @param l2 | |
* @return | |
*/ | |
private static function getCrossCoord(coef1:Object, coef2:Object):Point { | |
var a1:Number = coef1.a; | |
var b1:Number = coef1.b; | |
var c1:Number = coef1.c; |
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
package ru.gotoandstop.display { | |
import flash.display.DisplayObject; | |
import flash.display.Sprite; | |
import flash.events.Event; | |
import flash.events.IEventDispatcher; | |
import flash.events.MouseEvent; | |
[Event(name="change", type="flash.events.Event")] | |
/** | |
* @author Roman Timashev (roman@tmshv.ru) |
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
void drawArc(int center_x, int center_y, float start_a, float finish_a, float inner_radius, float outer_radius) { | |
fill(color(0, 0, 0)); | |
float angle_delta = finish_a - start_a; | |
int pass_length = 1; | |
int pass_number = 0; | |
float angular_step = 0; | |
float cur_x = 0; | |
float cur_y = 0; | |
float current_angle = 0; |
NewerOlder