2013-06-17 13:42:53 +04:00
|
|
|
// TODO(grosbouddha): put under pskl namespace.
|
2013-08-11 12:04:35 +04:00
|
|
|
var Constants = {
|
2013-09-22 23:02:43 +04:00
|
|
|
DEFAULT : {
|
|
|
|
HEIGHT : 32,
|
|
|
|
WIDTH : 32,
|
|
|
|
FPS : 12
|
2013-08-10 14:11:16 +04:00
|
|
|
},
|
2012-09-16 20:48:32 +04:00
|
|
|
|
fix : reduce piskel model size
- Initial implementation : working but ...
- MODEL_VERSION has been bumped to 2
- The loading process is now theoretically asynchronous (loading images to
read the content of the layers), but for now, the asynchronous behaviour
is hidden behind a nasty hack, which is somehow similar to lazy loading.
When loading the piskel, a Piskel is created synchronously, with fake
empty frames, and as the images will get loaded, the fake frames will be
replaced by the actual frames.
I really don't like this, and the asynchronous nature of the loading
should be clearly expressed
- There is no backward compatible deserializer for the previous version of
the model (1)
- The Serializer utils is just badly designed. Serialization and
deserialization should be splitted into two different classes
- Saving & loading are still done in app.js and should be moved to
services
BUT : the size of the piskels is now pretty small. A piskel which was
using 890kB previously is now using only 10kB. Although it should be
noted, that after gzip there is no significant difference between this
version and the existing one. The only gains we can really expect with
this are : less disk space used on appengine, ability to reuse the
layers' pngs directly on piskel-website (but to be honest I can't see any
valid use case for this)
2013-11-08 03:44:24 +04:00
|
|
|
MODEL_VERSION : 2,
|
2013-09-22 23:02:43 +04:00
|
|
|
|
2013-10-30 01:16:39 +04:00
|
|
|
MAX_HEIGHT : 1024,
|
|
|
|
MAX_WIDTH : 1024,
|
2012-09-03 03:34:11 +04:00
|
|
|
|
2013-08-10 16:28:10 +04:00
|
|
|
PREVIEW_FILM_SIZE : 120,
|
2013-08-06 01:34:11 +04:00
|
|
|
|
2013-09-29 01:52:51 +04:00
|
|
|
DEFAULT_PEN_COLOR : '#000000',
|
2013-11-21 03:44:46 +04:00
|
|
|
TRANSPARENT_COLOR : 'rgba(0, 0, 0, 0)',
|
2013-09-30 01:26:09 +04:00
|
|
|
|
2013-08-10 14:11:16 +04:00
|
|
|
/*
|
|
|
|
* Fake semi-transparent color used to highlight transparent
|
|
|
|
* strokes and rectangles:
|
|
|
|
*/
|
|
|
|
SELECTION_TRANSPARENT_COLOR: 'rgba(255, 255, 255, 0.6)',
|
2012-09-16 17:35:30 +04:00
|
|
|
|
2013-08-10 14:11:16 +04:00
|
|
|
/*
|
|
|
|
* When a tool is hovering the drawing canvas, we highlight the eventual
|
|
|
|
* pixel target with this color:
|
|
|
|
*/
|
|
|
|
TOOL_TARGET_HIGHLIGHT_COLOR: 'rgba(255, 255, 255, 0.2)',
|
2013-09-30 01:26:09 +04:00
|
|
|
|
2013-08-10 14:11:16 +04:00
|
|
|
/*
|
|
|
|
* Default entry point for piskel web service:
|
|
|
|
*/
|
2013-10-10 02:06:11 +04:00
|
|
|
STATIC : {
|
|
|
|
URL : {
|
|
|
|
SAVE : 'http://3.piskel-app.appspot.com/store',
|
|
|
|
GET : 'http://3.piskel-app.appspot.com/get'
|
|
|
|
}
|
|
|
|
},
|
|
|
|
APPENGINE : {
|
|
|
|
URL : {
|
|
|
|
SAVE : 'save'
|
|
|
|
}
|
|
|
|
},
|
2013-09-30 01:26:09 +04:00
|
|
|
IMAGE_SERVICE_UPLOAD_URL : 'http://screenletstore.appspot.com/__/upload',
|
|
|
|
IMAGE_SERVICE_GET_URL : 'http://screenletstore.appspot.com/img/',
|
2012-09-09 01:43:16 +04:00
|
|
|
|
2013-08-10 14:11:16 +04:00
|
|
|
GRID_STROKE_WIDTH: 1,
|
2013-11-05 03:05:49 +04:00
|
|
|
ZOOMED_OUT_BACKGROUND_COLOR : '#A0A0A0',
|
2013-04-09 09:24:07 +04:00
|
|
|
|
2013-09-30 01:26:09 +04:00
|
|
|
LEFT_BUTTON : 'left_button_1',
|
2013-11-01 19:27:23 +04:00
|
|
|
RIGHT_BUTTON : 'right_button_2',
|
2013-11-15 03:32:18 +04:00
|
|
|
MOUSEMOVE_THROTTLING : 10,
|
|
|
|
|
|
|
|
ABSTRACT_FUNCTION : function () {throw 'abstract method should be implemented';}
|
2012-08-31 12:45:07 +04:00
|
|
|
};
|