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
/* | |
The MIT License | |
Copyright (c) <year> <copyright holders> | |
Permission is hereby granted, free of charge, to any person obtaining a copy | |
of this software and associated documentation files (the "Software"), to deal | |
in the Software without restriction, including without limitation the rights | |
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
copies of the Software, and to permit persons to whom the Software is |
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
class Main { | |
// this particular setup gives me the error: | |
// Main.hx:12: characters 22-85 : Variable initialization must be a constant value | |
// set either GRID_SIZE, CELL_SIZE or OUTLINE_RATIO to anything else and it's fine | |
public static inline var GRID_SIZE :Int = 20; | |
public static inline var CELL_SIZE :Int = GRID_SIZE - 2; | |
public static inline var OUTLINE_RATIO :Float = 1.2; |
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 flash.text; | |
import openfl.text.TextField; | |
import openfl.text.TextFormat; | |
/** | |
* ... | |
* @author Martin Jonasson, m@grapefrukt.com | |
*/ | |
#if flash | |
typedef RTextField = TextField; |
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
static function setconfig(target:Dynamic, config:Dynamic) { | |
// iterate over the fields of the config object | |
for (key in Reflect.fields(config)) { | |
// make sure our target has this field | |
if (!Reflect.hasField(target, key)) continue; | |
// fetch the value of the first field | |
var configvalue:Dynamic = Reflect.field(config, key); | |
// check if its and object, and if so, make sure it actually has multiple values inside | |
// (strings are for some reason considered objects) |
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 com.grapefrukt.games.slicer.utils; | |
/** | |
* ... | |
* @author Martin Jonasson, m@grapefrukt.com | |
*/ | |
class ConvexHull { | |
public static function get<T:{x:Float, y:Float}>(vertices:Array<T>):Array<T> { |
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 STATIC_ASSERT(COND,MSG) typedef char static_assertion_##MSG[(COND)?1:-1] | |
#define CHECK_SIZE(a) (sizeof(a)/sizeof(a[0])) | |
#define NUM_DIR 4 | |
#define NUM_BUT 6 | |
#define NUM_INPUT (NUM_DIR + NUM_BUT) | |
#define LEFT 0 | |
#define RIGHT 1 | |
#define UP 2 |
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
// on init | |
TypeError: Error #1009: Cannot access a property or method of a null object reference. | |
at patterns.mvc.views.loader::AbstractLoader/show() | |
at patterns.mvc.views.loader::MainLoader/show() | |
at ApplicationHolder/onQueueStart() | |
at flash.events::EventDispatcher/dispatchEventFunction() | |
at flash.events::EventDispatcher/dispatchEvent() | |
at com.hydrotik.utils::QueueLoader/dispatchEvent() | |
at com.hydrotik.utils::QueueLoader/openHandler() |
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
Uncaught ReferenceError: Float32Array is not defined | |
THREE.WebGLRenderer/three.js/build/Three.js:138 | |
initgeometry_minecraft.html:125 | |
(anonymous function)geometry_minecraft.html:66 |
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
#aDir is a directory path | |
names = glob.glob(aDir + "/*.png") #file type of the packable images | |
#append to the list of image objects | |
if names: | |
images.extend(names); | |
# then sort later: | |
sortedImages = sorted([(i.size[1], name, i) for name,i in ((x,Image.open(x)) for x in images)], reverse=True) |
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
L-Button 1 2 50 W 87 F12 123 | |
R-Button 2 3 51 X 88 F13 124 | |
Cancel 3 4 52 Y 89 F14 125 | |
M-Button 4 5 53 Z 90 F15 126 | |
Back 8 6 54 NP - 0 96 F16 127 | |
Tab 9 7 55 NP - 1 97 F17 128 | |
Clear 12 8 56 NP - 2 98 F18 129 | |
Return 13 9 57 NP - 3 99 F19 130 | |
Shift 16 A 65 NP - 4 100 F20 131 | |
Control 17 B 66 NP - 5 101 F21 132 |
OlderNewer