Migrated the rest of the units.
This commit is contained in:
parent
288c26a11e
commit
d496f12981
48
README.md
48
README.md
@ -1,82 +1,76 @@
|
|||||||
#Ronin
|
#Ronin
|
||||||
|
|
||||||
##Canvas
|
##Canvas
|
||||||
```
|
```
|
||||||
@ 600x400 ; New canvas of size 600w and 400h
|
@ 600x400 ; New canvas of size 600w and 400h
|
||||||
@ 100x100 #ff0000 ; New canvas of size 100w and 100h with red background
|
@ 100x100 #ff0000 ; New canvas of size 100w and 100h with red background
|
||||||
@ ? ; Clear canvas
|
@ ? ; Clear canvas
|
||||||
```
|
```
|
||||||
|
|
||||||
##Background
|
|
||||||
```
|
|
||||||
* #ff0000 ; Fill background with red color
|
|
||||||
* ? ; Remove background
|
|
||||||
```
|
|
||||||
|
|
||||||
##History*
|
##History*
|
||||||
```
|
```
|
||||||
~ ; Keep image progress
|
~ ; Keep image progress
|
||||||
~ 3 ; Keep image progress into temporary memory with id 3
|
~ 3 ; Keep image progress into temporary memory with id 3
|
||||||
~ ? ; Clear history
|
~ ? ; Clear history
|
||||||
```
|
```
|
||||||
|
|
||||||
##Save File
|
##Save File
|
||||||
```
|
```
|
||||||
$ new_name.jpg ; Create a new file with name
|
$ new_name.jpg ; Create a new file with name
|
||||||
```
|
```
|
||||||
|
|
||||||
##Load File
|
##Load File
|
||||||
```
|
```
|
||||||
/ dir/file_name.jpg 10,10 100x100 ; Load image, at 10,10 with size 100x100
|
/ dir/file_name.jpg 10,10 100x100 ; Load image, at 10,10 with size 100x100
|
||||||
/ dir/file_name.jpg 10,10 100x ; Load image, at 10,10 with size 100w and auto height
|
/ dir/file_name.jpg 10,10 100x ; Load image, at 10,10 with size 100w and auto height
|
||||||
/ ~ ; Load last history id
|
/ ~ ; Load last history id
|
||||||
/ 3 ; Load history id
|
/ 3 ; Load history id
|
||||||
```
|
```
|
||||||
|
|
||||||
##Brush
|
##Brush
|
||||||
```
|
```
|
||||||
& 10 ; Size 10
|
& 10 ; Size 10
|
||||||
& -4 ; Eraser, Size 4
|
& -4 ; Eraser, Size 4
|
||||||
& 4 #ff0000 ; Red brush, Size 4
|
& 4 #ff0000 ; Red brush, Size 4
|
||||||
& ? ; Size 1, black
|
& ? ; Size 1, black
|
||||||
```
|
```
|
||||||
|
|
||||||
##Pointers
|
##Pointers
|
||||||
```
|
```
|
||||||
> 10,0 ; Add pointer at pos
|
> 10,0 ; Add pointer at pos
|
||||||
> 0,0 400,0 ; Mirror X, at 400px
|
> 0,0 400,0 ; Mirror X, at 400px
|
||||||
> ? ; Remove pointers
|
> ? ; Remove pointers
|
||||||
```
|
```
|
||||||
|
|
||||||
##Guides
|
##Guides
|
||||||
```
|
```
|
||||||
| 10,10 100x100 ; Draw a guide
|
| 10,10 100x100 ; Draw a guide
|
||||||
| -100,0 ; Draw a grid at every 100px
|
| -100,0 ; Draw a grid at every 100px
|
||||||
| ? ; Remove guides
|
| ? ; Remove guides
|
||||||
```
|
```
|
||||||
|
|
||||||
##Translate*
|
##Translate*
|
||||||
```
|
```
|
||||||
^ 0,10 ; Translate 10px vertically
|
^ 0,10 ; Translate 10px vertically
|
||||||
^ 20,20 100x100 40,40 ; Translate a specific portion to a specific location
|
^ 20,20 100x100 40,40 ; Translate a specific portion to a specific location
|
||||||
```
|
```
|
||||||
|
|
||||||
##Zoom*
|
##Zoom*
|
||||||
```
|
```
|
||||||
= 75 ; Zoom factor
|
= 75 ; Zoom factor
|
||||||
= ? ; Zoom 100%
|
= ? ; Zoom 100%
|
||||||
```
|
```
|
||||||
|
|
||||||
##Layers*
|
##Layers*
|
||||||
```
|
```
|
||||||
# 3 ; Layer 3
|
# 3 ; Layer 3
|
||||||
# ? ; Layer 1
|
# ? ; Layer 1
|
||||||
```
|
```
|
||||||
|
|
||||||
#Units*
|
#Units*
|
||||||
```
|
```
|
||||||
5 ; 5px
|
5 ; 5px
|
||||||
5,7 ; 5x 7y
|
5,7 ; 5x 7y
|
||||||
7x9 ; 7w 9h
|
7x9 ; 7w 9h
|
||||||
{5h - 5s} ; 5% of canvas width, minus brush speed
|
{5h - 5s} ; 5% of canvas width, minus brush speed
|
||||||
```
|
```
|
||||||
|
@ -3,13 +3,13 @@
|
|||||||
<link rel="stylesheet" type="text/css" href="links/main.css"/>
|
<link rel="stylesheet" type="text/css" href="links/main.css"/>
|
||||||
|
|
||||||
<script type="text/javascript" src="scripts/unit.rect.js"></script>
|
<script type="text/javascript" src="scripts/unit.rect.js"></script>
|
||||||
|
<script type="text/javascript" src="scripts/unit.color.js"></script>
|
||||||
|
<script type="text/javascript" src="scripts/unit.position.js"></script>
|
||||||
|
|
||||||
<script type="text/javascript" src="scripts/ronin.module.js"></script>
|
<script type="text/javascript" src="scripts/ronin.module.js"></script>
|
||||||
<script type="text/javascript" src="scripts/ronin.canvas.js"></script>
|
<script type="text/javascript" src="scripts/ronin.canvas.js"></script>
|
||||||
<script type="text/javascript" src="scripts/ronin.overlay.js"></script>
|
<script type="text/javascript" src="scripts/ronin.overlay.js"></script>
|
||||||
|
|
||||||
<script type="text/javascript" src="scripts/position.js"></script>
|
|
||||||
<script type="text/javascript" src="scripts/color.js"></script>
|
|
||||||
<script type="text/javascript" src="scripts/pointer.js"></script>
|
<script type="text/javascript" src="scripts/pointer.js"></script>
|
||||||
<script type="text/javascript" src="scripts/brush.js"></script>
|
<script type="text/javascript" src="scripts/brush.js"></script>
|
||||||
<script type="text/javascript" src="scripts/keyboard.js"></script>
|
<script type="text/javascript" src="scripts/keyboard.js"></script>
|
||||||
|
@ -14,7 +14,12 @@ function Canvas(element)
|
|||||||
|
|
||||||
if(p.length > 1 && p[1].indexOf("#") >= 0){
|
if(p.length > 1 && p[1].indexOf("#") >= 0){
|
||||||
var color = new Color(p[1]);
|
var color = new Color(p[1]);
|
||||||
console.log("TODO: Fill with color");
|
console.log(color);
|
||||||
|
|
||||||
|
this.element.getContext('2d').beginPath();
|
||||||
|
this.element.getContext('2d').rect(0, 0, canvas.width, canvas.height);
|
||||||
|
this.element.getContext('2d').fillStyle = color.hex;
|
||||||
|
this.element.getContext('2d').fill();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,10 +1,10 @@
|
|||||||
function Color(val = '000000')
|
function Color(hex = '#000000')
|
||||||
{
|
{
|
||||||
this.val = val;
|
this.hex = hex;
|
||||||
|
|
||||||
this.rgb = function()
|
this.rgb = function()
|
||||||
{
|
{
|
||||||
var result = /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(this.val);
|
var result = /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(this.hex);
|
||||||
return result ? {
|
return result ? {
|
||||||
r: parseInt(result[1], 16),
|
r: parseInt(result[1], 16),
|
||||||
g: parseInt(result[2], 16),
|
g: parseInt(result[2], 16),
|
Loading…
x
Reference in New Issue
Block a user