Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge latest main #842

Merged
merged 18 commits into from
Jun 27, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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