Skip to content

Commit

Permalink
Merge pull request #842 from GuoLei1990/dev/0.8
Browse files Browse the repository at this point in the history
Merge latest main
  • Loading branch information
GuoLei1990 authored Jun 27, 2022
2 parents 107e157 + b01d9b1 commit 84e16c4
Show file tree
Hide file tree
Showing 41 changed files with 476 additions and 316 deletions.
2 changes: 1 addition & 1 deletion lerna.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"npmClient": "npm",
"version": "0.7.0-beta.6",
"version": "0.7.0-beta.7",
"bootstrap": {
"hoist": true
},
Expand Down
6 changes: 3 additions & 3 deletions packages/core/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@oasis-engine/core",
"version": "0.7.0-beta.6",
"version": "0.7.0-beta.7",
"license": "MIT",
"main": "dist/main.js",
"module": "dist/module.js",
Expand All @@ -14,9 +14,9 @@
"types/**/*"
],
"dependencies": {
"@oasis-engine/math": "0.7.0-beta.6"
"@oasis-engine/math": "0.7.0-beta.7"
},
"devDependencies": {
"@oasis-engine/design": "0.7.0-beta.6"
"@oasis-engine/design": "0.7.0-beta.7"
}
}
16 changes: 10 additions & 6 deletions packages/core/src/2d/text/TextRenderer.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,18 @@
import { BoundingBox, Color, Vector3 } from "@oasis-engine/math";
import { Sprite, SpriteMaskInteraction, SpriteMaskLayer, SpriteRenderer } from "..";
import { CompareFunction, Renderer, UpdateFlag } from "../..";
import { BoolUpdateFlag } from "../../BoolUpdateFlag";
import { Camera } from "../../Camera";
import { assignmentClone, deepClone, ignoreClone } from "../../clone/CloneManager";
import { Entity } from "../../Entity";
import { Renderer } from "../../Renderer";
import { CompareFunction } from "../../shader/enums/CompareFunction";
import { Texture2D } from "../../texture";
import { FontStyle } from "../enums/FontStyle";
import { SpriteMaskInteraction } from "../enums/SpriteMaskInteraction";
import { SpriteMaskLayer } from "../enums/SpriteMaskLayer";
import { TextHorizontalAlignment, TextVerticalAlignment } from "../enums/TextAlignment";
import { OverflowMode } from "../enums/TextOverflow";
import { Sprite } from "../sprite/Sprite";
import { SpriteRenderer } from "../sprite/SpriteRenderer";
import { Font } from "./Font";
import { TextUtils } from "./TextUtils";

Expand Down Expand Up @@ -377,21 +381,21 @@ export class TextRenderer extends Renderer {
const { pixelsPerUnit, pivot } = sprite;
switch (horizontalAlignment) {
case TextHorizontalAlignment.Left:
pivot.x = (this.width * pixelsPerUnit) / width * 0.5;
pivot.x = ((this.width * pixelsPerUnit) / width) * 0.5;
break;
case TextHorizontalAlignment.Right:
pivot.x = 1 - (this.width * pixelsPerUnit) / width * 0.5;
pivot.x = 1 - ((this.width * pixelsPerUnit) / width) * 0.5;
break;
case TextHorizontalAlignment.Center:
pivot.x = 0.5;
break;
}
switch (verticalAlignment) {
case TextVerticalAlignment.Top:
pivot.y = 1 - (this.height * pixelsPerUnit) / height * 0.5;
pivot.y = 1 - ((this.height * pixelsPerUnit) / height) * 0.5;
break;
case TextVerticalAlignment.Bottom:
pivot.y = (this.height * pixelsPerUnit) / height * 0.5;
pivot.y = ((this.height * pixelsPerUnit) / height) * 0.5;
break;
case TextVerticalAlignment.Center:
pivot.y = 0.5;
Expand Down
5 changes: 2 additions & 3 deletions packages/core/src/animation/AnimationClip.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ export class AnimationClip extends Motion {
/**
* @param name - The AnimationClip's name
*/
constructor (public readonly name: string) {
constructor(public readonly name: string) {
super();
}

Expand All @@ -60,9 +60,8 @@ export class AnimationClip extends Motion {
*/
addEvent(event: AnimationEvent): void;


addEvent(param: AnimationEvent | string, time?: number, parameter?: Object): void {
if (typeof param === 'string') {
if (typeof param === "string") {
const event = new AnimationEvent();
event.functionName = param;
event.time = time;
Expand Down
Loading

0 comments on commit 84e16c4

Please sign in to comment.