
Herbert
Members-
Content Count
92 -
Joined
-
Last visited
Everything posted by Herbert
-
Sounds good, I am going to do it this way, thanks @ivan.popelyshev
-
I used to use devtools to do so, however, I hope to log or alert it out for some non-developer so they can re-upload sprite sheet by themselves.
-
Hi there, I want to catch the error of the mismatch of sprite sheet and console out the filename with problem. I found this article(https://github.com/pixijs/pixi.js/issues/4599) which seems fulfill my need, but I follow the way shows in fiddles, and it doesn't work, onError is not triggered on 'Texture Error: frame does not fit inside the base Texture dimensions'. Did I miss something? PIXI.loader.onError.add(function(error, loader, resource) { console.log('catch error'); });
-
thank you guys, I got the idea~
-
hi there, I have two overlap sprites both are interactive, how can I trigger both of their click Event?
-
It's resolved. anchor.y based on lineHeight, and in my .fnt file, I didn't set it correctly. Thanks @ivan.popelyshev
-
lineHeight it is, my lineHeight is not the same as char height before(as shown). So If I want the anchor.y based on char height, I need to make sure lineHeight is set to the same value, and as @ivan.popelyshev said, be aware of offset. <font> <info face="num_02" size="32" bold="0" italic="0" charset="" unicode="1" stretchH="100" smooth="1" aa="1" padding="0,0,0,0" spacing="1,1" outline="0"/> <common lineHeight="32" base="26" scaleW="256" scaleH="256" pages="1" packed="0" alphaChnl="0" redChnl="4" greenChnl="4" blueChnl="4"/> <pages> <page id="0" file=
-
hi, I found out that the anchor.y is inaccurate for BitmapText. When I set it to 0.5, it doesn't align to center, but if I set anchor.y to 0 and add half of it's height to y, it will correctly locate at center.
-
hi @ivan.popelyshev, Thanks for your hints, I got it works by calling updateTransform of all spines in my custom setInterval which will keep firing on blur. something like createSpine(data, opts) { const spine = new PIXI.spine.Spine(data, opts); this.updateList.push(spine); return spine; } updateOnBlur() { // update animatedSprite PIXI.ticker.shared.update(); // update spine this.updateList.forEach(spine => spine.updateTransform()); } I am wondering is there any setting that I can apply shared ticker to all spines, so I don't need to store them
-
hi guys, How can I make a spine keep checking onComplete Event while losing tab focus? As I tested, if I run several spine animations(different length) at the same time, then switch to another tab immediately, the onComplete events won't fire, but they will fire at once when the tab get focus again.
-
Hey guys I try to make a simple sport game, so first, I want to make a person stand on a ground who can run and jump on it, and I have trouble on the jump part, the dude won't stop by the ground when he is dropping from a height(https://www.babylonjs-playground.com/#1BZJVJ#113) if the position.y is 0, then the dude can stand fine on the ground
-
solved Can I load a spritesheet with BABYLON
Herbert replied to Herbert's topic in Questions & Answers
ok, thank you~- 8 replies
-
- spritesheet
- babylon
-
(and 1 more)
Tagged with:
-
solved Can I load a spritesheet with BABYLON
Herbert replied to Herbert's topic in Questions & Answers
hi @Deltakosh I only find sourceXXX properties in GUI.Image. So perhaps I should create my own imageButton class based on GUI.Image. By the way, GUI seems only shows on the scene which is created LAST, not so sure if it is a bug? I borrow the PG in this post and make some changes to reproduce the issue(http://www.html5gamedevs.com/topic/15501-changing-scenes-locations/) here's the PG(http://www.babylonjs-playground.com/#1B3R9A#33) so I create a GUI button while scene 0 is being rendered(button not showing) then I switch to render scene 1 which is created later(the bu- 8 replies
-
- spritesheet
- babylon
-
(and 1 more)
Tagged with:
-
solved Can I load a spritesheet with BABYLON
Herbert replied to Herbert's topic in Questions & Answers
hi @jerome for the place I used it most is GUI, things like BABYLON.GUI.Button.CreateImageOnlyButton BABYLON.GUI.Image- 8 replies
-
- spritesheet
- babylon
-
(and 1 more)
Tagged with:
-
solved Can I load a spritesheet with BABYLON
Herbert replied to Herbert's topic in Questions & Answers
hi @aWeirdo thanks, but it's a bit different, I don't use it for animation, so in my case every frame's size is different, I just want to pack all the small images into one to save requests- 8 replies
-
- spritesheet
- babylon
-
(and 1 more)
Tagged with:
-
hi guys, Is there a way to load 2D-resources as spritesheet in BABYLON, and I can take the frame I want by alias(frame_1.png or frame_2.png)? or if I need to do it myself, where can I set the attributes like clipX, clipY ......to get the part of image I want {"frames": { "frame_1.png": { "frame": {"x":1,"y":1417,"w":93,"h":102}, "rotated": false, "trimmed": true, "spriteSourceSize": {"x":5,"y":0,"w":93,"h":102}, "sourceSize": {"w":98,"h":102} }, "frame_2.png": { "frame": {"x":311,"y":1187,"w":84,"h":102}, "rotated": false, "trimmed": true, "spriteSourceSize": {"x":13,"y":
- 8 replies
-
- spritesheet
- babylon
-
(and 1 more)
Tagged with:
-
Error when I set Engine => lockstepMaxSteps higher than 1
Herbert replied to Herbert's topic in Questions & Answers
I thought max version refers to latest version ok, I will try babylon.max. and I will try to reproduce it on PG, just wonder how I can switch scene on PG(since runRenderLoop is called outside)? "the render loop starts and ends with the same scene" => does that mean I have to call stopRenderLoop before I switch scene and start a new loop? var scene = createScene(engine); var scene2 = createScene(engine); var renderLoop = engine.runRenderLoop(function () { scene.render(); }); setTimeout(function() { engine.stopRenderLoop(renderLoop); engine.runRenderLoop(f -
Error when I set Engine => lockstepMaxSteps higher than 1
Herbert replied to Herbert's topic in Questions & Answers
So it might happen when I try to switch the scene to be rendered. var scene = createScene(engine); var scene2 = createScene(engine); var sceneOption = [ scene, scene2 ]; var sceneIndex = 0; setTimeout(() => { sceneIndex = 1; }, 0); engine.runRenderLoop(function () { sceneOption[sceneIndex].render(); }); and it depends on the timing you switch the scene(e.g. maybe switch at 10ms is alright, but might go wrong at 11ms) -
Error when I set Engine => lockstepMaxSteps higher than 1
Herbert replied to Herbert's topic in Questions & Answers
Hi @RelativeNull This is already tested in the latest version(3.1 alpha) I recreate a simple project and everything goes well, so I think it only happens to a specific case. I will test around it, if I find something I will post it here. but i am also curios why does the speed become so slow in this PG example(https://www.babylonjs-playground.com/#DU4FPJ#3)