Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- draw: function() {
- // Bounds
- if( this.active ) {
- ig.system.context.lineWidth = 1;
- ig.system.context.strokeStyle = wm.config.colors.primary;
- ig.system.context.strokeRect(
- -ig.system.getDrawPos(this.scroll.x) - 0.5,
- -ig.system.getDrawPos(this.scroll.y) - 0.5,
- this.width * this.tilesize * ig.system.scale + 1,
- this.height * this.tilesize * ig.system.scale + 1
- );
- }
- if( this.visible ) {
- this.parent();
- }
- // Grid
- if( this.active ) {
- var x = -ig.system.getDrawPos(this.scroll.x % this.tilesize) - 0.5;
- var y = -ig.system.getDrawPos(this.scroll.y % this.tilesize) - 0.5;
- var step = this.tilesize * ig.system.scale;
- for( x; x < ig.system.realWidth; x += step ) {
- ig.system.context.moveTo( x, 0 );
- ig.system.context.lineTo( x, ig.system.realHeight );
- }
- for( y; y < ig.system.realHeight; y += step ) {
- ig.system.context.moveTo( 0, y );
- ig.system.context.lineTo( ig.system.realWidth, y );
- }
- ig.system.context.strokeStyle = wm.config.colors.secondary;
- ig.system.context.stroke();
- }
- },
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement