Skip to content

Commit

Permalink
add scale factor for stand animation
Browse files Browse the repository at this point in the history
  • Loading branch information
neolao authored Mar 26, 2020
1 parent 8d973b6 commit ffde1f7
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 1 deletion.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,7 @@ Character properties
| `stand2` | Image path of the character stand animation for color 2 (default: `stand2.gif`) |
| `standOptions.x` | Override x coordinate for the character stand animation (default: `47vw`) |
| `standOptions.y` | Override y coordinate for the character stand animation (default: `2vh`) |
| `standOptions.scale` | Set the scale factor of the character stand animation (default: `1`) |
| `thumbnail` | Image path of the character thumbnail (default: `thumbnail.png`) |
| `styles` | Alternative styles. List of characters (default: `[]`) |
| `random` | Indicates that this character is random one within category (default: `false`) |
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "mugen-quick-versus-launcher",
"author": "neolao",
"license": "MIT",
"version": "0.28.1",
"version": "0.29.0",
"description": "Mugen launcher for Quick Versus",
"keywords": [
"mugen",
Expand Down
2 changes: 2 additions & 0 deletions src/side/common/randomCharacterName.presenter.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ export default function RandomCharacterName() {
const names = useSelectableCharactersNames();

useEffect(() => {
console.log("Total characters: ", names.length);

let requestId;
const chooseRandomName = () => {
const name = names[Math.floor(Math.random() * names.length)];
Expand Down
5 changes: 5 additions & 0 deletions src/side/left/standAnimation.view.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -43,5 +43,10 @@ export default function StandAnimation({ character, colorIndex }) {
xScale *= options.scaleFactor;
yScale *= options.scaleFactor;

if (character.standOptions && character.standOptions.scale > 0) {
xScale *= character.standOptions.scale;
yScale *= character.standOptions.scale;
}

return <Image src={standAnimation} x={x} y={y} xScale={xScale} yScale={yScale} key={JSON.stringify(character)}/>;
}

0 comments on commit ffde1f7

Please sign in to comment.