Skip to content

Commit

Permalink
build v1.0.5
Browse files Browse the repository at this point in the history
  • Loading branch information
shakiba committed Aug 16, 2024
1 parent 363f566 commit 4b6d6ec
Show file tree
Hide file tree
Showing 14 changed files with 208 additions and 107 deletions.
16 changes: 8 additions & 8 deletions dist/planck-with-testbed.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1391,7 +1391,7 @@ declare class Contact {
flagForFiltering(): void;
/**
* Override the default friction mixture. You can call this in
* ContactListener.preSolve. This value persists until set or reset.
* "pre-solve" callback. This value persists until set or reset.
*/
setFriction(friction: number): void;
/**
Expand All @@ -1404,7 +1404,7 @@ declare class Contact {
resetFriction(): void;
/**
* Override the default restitution mixture. You can call this in
* ContactListener.preSolve. The value persists until you set or reset.
* "pre-solve" callback. The value persists until you set or reset.
*/
setRestitution(restitution: number): void;
/**
Expand Down Expand Up @@ -2104,8 +2104,8 @@ declare class World {
* provided so that you can detect changes. Note: this is called only for awake
* bodies. Note: this is called even when the number of contact points is zero.
* Note: this is not called for sensors. Note: if you set the number of contact
* points to zero, you will not get an endContact callback. However, you may get
* a beginContact callback the next step.
* points to zero, you will not get an end-contact callback. However, you may get
* a begin-contact callback the next step.
*
* Warning: You cannot create/destroy world entities inside these callbacks.
*/
Expand Down Expand Up @@ -5715,7 +5715,7 @@ declare namespace planck {
flagForFiltering(): void;
/**
* Override the default friction mixture. You can call this in
* ContactListener.preSolve. This value persists until set or reset.
* "pre-solve" callback. This value persists until set or reset.
*/
setFriction(friction: number): void;
/**
Expand All @@ -5728,7 +5728,7 @@ declare namespace planck {
resetFriction(): void;
/**
* Override the default restitution mixture. You can call this in
* ContactListener.preSolve. The value persists until you set or reset.
* "pre-solve" callback. The value persists until you set or reset.
*/
setRestitution(restitution: number): void;
/**
Expand Down Expand Up @@ -6449,8 +6449,8 @@ declare namespace planck {
* provided so that you can detect changes. Note: this is called only for awake
* bodies. Note: this is called even when the number of contact points is zero.
* Note: this is not called for sensors. Note: if you set the number of contact
* points to zero, you will not get an endContact callback. However, you may get
* a beginContact callback the next step.
* points to zero, you will not get an end-contact callback. However, you may get
* a begin-contact callback the next step.
*
* Warning: You cannot create/destroy world entities inside these callbacks.
*/
Expand Down
114 changes: 76 additions & 38 deletions dist/planck-with-testbed.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* Planck.js v1.0.4
* Planck.js v1.0.5
* @license The MIT license
* @copyright Copyright (c) 2023 Erin Catto, Ali Shakiba
*
Expand Down Expand Up @@ -7310,7 +7310,7 @@
};
/**
* Override the default friction mixture. You can call this in
* ContactListener.preSolve. This value persists until set or reset.
* "pre-solve" callback. This value persists until set or reset.
*/
Contact.prototype.setFriction = function (friction) {
this.m_friction = friction;
Expand All @@ -7333,7 +7333,7 @@
};
/**
* Override the default restitution mixture. You can call this in
* ContactListener.preSolve. The value persists until you set or reset.
* "pre-solve" callback. The value persists until you set or reset.
*/
Contact.prototype.setRestitution = function (restitution) {
this.m_restitution = restitution;
Expand Down Expand Up @@ -16116,6 +16116,30 @@
stats: stats$1
};

/**
* Stage.js 1.0.0-alpha.3
*
* @copyright Copyright (c) 2024 Ali Shakiba
* @license The MIT License (MIT)
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
const math_random = Math.random;
const math_sqrt$1 = Math.sqrt;
function random(min, max) {
Expand Down Expand Up @@ -16679,7 +16703,7 @@
const NO_SELECTION = new TextureSelection(NO_TEXTURE);
const ATLAS_MEMO_BY_NAME = {};
const ATLAS_ARRAY = [];
const atlas = async function(def) {
async function atlas(def) {
let atlas2;
if (def instanceof Atlas) {
atlas2 = def;
Expand All @@ -16692,8 +16716,8 @@
ATLAS_ARRAY.push(atlas2);
await atlas2.load();
return atlas2;
};
const texture = function(query) {
}
function texture(query) {
if ("string" !== typeof query) {
return new TextureSelection(query);
}
Expand All @@ -16720,7 +16744,7 @@
result = NO_SELECTION;
}
return result;
};
}
class ResizableTexture extends Texture {
constructor(source, mode) {
super();
Expand Down Expand Up @@ -17625,30 +17649,30 @@
}
throw "Invalid node: " + obj;
}
const create = function() {
function create() {
return layout();
};
const layer = function() {
}
function layer() {
return maximize();
};
const box = function() {
}
function box() {
return minimize();
};
const layout = function() {
}
function layout() {
return new Node();
};
const row = function(align) {
}
function row(align) {
return layout().row(align).label("Row");
};
const column = function(align) {
}
function column(align) {
return layout().column(align).label("Column");
};
const minimize = function() {
}
function minimize() {
return layout().minimize().label("Minimize");
};
const maximize = function() {
}
function maximize() {
return layout().maximize().label("Maximize");
};
}
class Node {
constructor() {
this.uid = "node:" + uid();
Expand Down Expand Up @@ -18482,14 +18506,16 @@
return this;
}
}
const sprite = function(frame) {
function sprite(frame) {
const sprite2 = new Sprite();
frame && sprite2.texture(frame);
return sprite2;
};
}
class Sprite extends Node {
constructor() {
super();
this._tiled = false;
this._stretched = false;
this.prerenderContext = {};
this.label("Sprite");
this._textures = [];
Expand All @@ -18500,7 +18526,13 @@
if (this._image) {
this.pin("width", this._image.getWidth());
this.pin("height", this._image.getHeight());
this._textures[0] = new PipeTexture(this._image);
if (this._tiled) {
this._textures[0] = new ResizableTexture(this._image, "tile");
} else if (this._stretched) {
this._textures[0] = new ResizableTexture(this._image, "stretch");
} else {
this._textures[0] = new PipeTexture(this._image);
}
this._textures.length = 1;
} else {
this.pin("width", 0);
Expand All @@ -18514,11 +18546,13 @@
return this.texture(frame);
}
tile(inner = false) {
this._tiled = true;
const texture2 = new ResizableTexture(this._image, "tile");
this._textures[0] = texture2;
return this;
}
stretch(inner = false) {
this._stretched = true;
const texture2 = new ResizableTexture(this._image, "stretch");
this._textures[0] = texture2;
return this;
Expand Down Expand Up @@ -18886,22 +18920,22 @@
CANCEL: "touchcancel mousecancel"
};
const ROOTS = [];
const pause = function() {
function pause() {
for (let i = ROOTS.length - 1; i >= 0; i--) {
ROOTS[i].pause();
}
};
const resume = function() {
}
function resume() {
for (let i = ROOTS.length - 1; i >= 0; i--) {
ROOTS[i].resume();
}
};
const mount = function(configs = {}) {
}
function mount(configs = {}) {
const root = new Root();
root.mount(configs);
root.pointer = new Pointer().mount(root, root.dom);
return root;
};
}
class Root extends Node {
constructor() {
super();
Expand Down Expand Up @@ -19145,12 +19179,12 @@
return this;
}
}
const anim = function(frames, fps) {
function anim(frames, fps) {
const anim2 = new Anim();
anim2.frames(frames).gotoFrame(0);
fps && anim2.fps(fps);
return anim2;
};
}
const FPS = 15;
class Anim extends Node {
constructor() {
Expand Down Expand Up @@ -19247,10 +19281,10 @@
return this;
}
}
const string = function(chars) {
return new Str().frames(chars);
};
class Str extends Node {
function monotype(chars) {
return new Monotype().frames(chars);
}
class Monotype extends Node {
constructor() {
super();
this.label("String");
Expand Down Expand Up @@ -19310,6 +19344,8 @@
return this;
}
}
const string = monotype;
const Str = Monotype;
const Stage = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
__proto__: null,
Anim,
Expand All @@ -19319,6 +19355,7 @@
ImageTexture,
Math: math,
Matrix,
Monotype,
Mouse,
Node,
POINTER_CANCEL,
Expand Down Expand Up @@ -19352,6 +19389,7 @@
maximize,
memoizeDraw,
minimize,
monotype,
mount,
pause,
random,
Expand Down
2 changes: 1 addition & 1 deletion dist/planck-with-testbed.js.map

Large diffs are not rendered by default.

29 changes: 27 additions & 2 deletions dist/planck-with-testbed.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/planck-with-testbed.min.js.map

Large diffs are not rendered by default.

Loading

0 comments on commit 4b6d6ec

Please sign in to comment.