Skip to content

Commit

Permalink
add files I forgot to commit
Browse files Browse the repository at this point in the history
  • Loading branch information
victorqribeiro committed Oct 15, 2020
1 parent d9ad685 commit 6d82e0a
Show file tree
Hide file tree
Showing 9 changed files with 5,062 additions and 3 deletions.
1 change: 1 addition & 0 deletions css/solid.min.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 6 additions & 3 deletions js/Map.class.js
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ class Map {

c.drawImage(
t.image,
x * (t.tileRealWidth + t.border),
x * (t.tileRealWidth + t.border),
y * (t.tileRealHeight + t.border),
t.tileRealWidth, t.tileRealHeight,
-t.tileWidth/2, -t.tileRealHeight+t.tileHeight+t.bottomOffset,
Expand Down Expand Up @@ -147,10 +147,13 @@ class Map {
}

paintCustomIsometric(brush,nlayer,posy,posx){
const scaleV = Math.floor(t.tileRealHeight/t.tileHeight)
for(let i = 0; i < brush.data.length; i++){
for(let j = 0; j < brush.data[0].length; j++){
if( posy+i+j < this.intH && posx+i-j < this.intW )
this.layers[nlayer][posy+i+j][posx+i-j] = brush.data[i][j]
const posY = posy + (i * scaleV) + j
const posX = posx + (i * scaleV) - j
if( posY < this.intH && posX < this.intW )
this.layers[nlayer][posY][posX] = brush.data[i][j]
}
}
}
Expand Down
21 changes: 21 additions & 0 deletions js/Texture.class.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
class Texture {

constructor(imgSrc, imgName, tileRealWidth, tileRealHeight, border, tileWidth, tileHeight, bottomOffset){
this.src = imgSrc
this.name = imgName
this.tileRealWidth = tileRealWidth
this.tileRealHeight = tileRealHeight
this.border = border
this.tileWidth = tileWidth
this.tileHeight = tileHeight
this.bottomOffset = bottomOffset
}

load(callback){
const url = window.URL || window.webkitURL
this.image = new Image()
this.image.src = this.src = url.createObjectURL(this.src)
this.image.onload = callback
}

}
6 changes: 6 additions & 0 deletions js/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,10 @@ const createTexturePalette = (imgSrc, imgName, tileRealWidth, tileRealHeight, bo
eraser.className = 'tool'
eraser.innerText = '\uf12d'
eraser.onclick = () => {
if(!brush)
brush = {
'type': 'default'
}
if(brush.type == 'custom')
brush.type = 'default'
brush.data = 0
Expand All @@ -171,6 +175,8 @@ const createTexturePalette = (imgSrc, imgName, tileRealWidth, tileRealHeight, bo
bucket.className = 'tool'
bucket.innerText = '\uf576'
bucket.onclick = () => {
if(!brush)
return
if(brush.type == 'custom')
brush.type = 'default'
brush.type = 'bucket'
Expand Down
Binary file added webfonts/fa-solid-900.eot
Binary file not shown.
5,028 changes: 5,028 additions & 0 deletions webfonts/fa-solid-900.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added webfonts/fa-solid-900.ttf
Binary file not shown.
Binary file added webfonts/fa-solid-900.woff
Binary file not shown.
Binary file added webfonts/fa-solid-900.woff2
Binary file not shown.

0 comments on commit 6d82e0a

Please sign in to comment.