Ok looks like it ok if no skin is used or default skin, but Darkly skin is not :)
Uldis Baurovskis
@Hersir
Posts made by Hersir
-
RE: HaxeFlixel forum broken on mac safari
-
HaxeFlixel forum broken on mac safari
Hi, wanted to inform that forum is totaly broken on mac safari browser 11.0.2.
Top menu is not rendered properly and adding new messages fields is messed up as well. -
Scroll factor and bounds
Hi, I have
FlxSpriteGroup
with someFlxSprites
ini it. This group hasheight
of game butwidth
is wider as game width.
Icentred
this group and than addedFlxG.camera.setScrollBoundsRect(map.x, map.y, map.width, map.height);
to set bounds.
On update:
override public function update(elapsed: Float) { super.update(elapsed); if (FlxG.keys.pressed.LEFT ) { FlxG.camera.scroll.add(-10); } if (FlxG.keys.pressed.RIGHT) { FlxG.camera.scroll.add(10); } }
Scroll works fine and limits are correct so camera stops on bounds, but as soon as I change
map.scrollFactor.x = 3
it scroll out of bounds. I am doing something wrong? -
RE: FlxSprite scale
On more thing what I noticed after scale, is that margins between objects became uneven (some rows have bigger margin some smaller, before distance between objects was the same) , do I need to swicth on/off some pixel snapping or there is something more?
-
RE: FlxSprite scale
Ok flip issue was my error, I called
updateHitbox();
after each texture change and after scale tweenscale.x
was0
sowidth
was0
. -
RE: FlxSprite scale
@Gama11 Thx for fast answer. Looks like setting
pixelPerfect
tofalse
did the trick, it will even work form me as I have almost square objects. So first problem is solved. Second problem is that after settingscale
and callingupdateHitbox
flip animation stoped to work properly.public function new() { super(); FlxMouseEventManager.add(this , onDown, onUp, onOver, onOut, false, true, false); scale.set(0.25, 0.25); addTexture("back-of-card.png"); } function addTexture(label: String) { this.frames = FlxAtlasFrames.fromTexturePackerJson( "path-to-atlas.png", "path-to-atla.json" ); animation.frameName = label; updateHitbox(); } public function flip() { FlxTween.tween(scale, { x: 0 }, 0.1, { onComplete: onFlipReady }); } function onFlipReady() { addTexture("other-side-of-card.png"); FlxTween.tween(scale, { x: 0.25 }, 0.1); }
Before it was working properly and card was flipped from centre of card, now it flips using left side as centre, so card moves left by half of width after flip tween.
-
RE: FlxSprite scale
Sorry :), I will try to explain better. I made minimal code for first problem:
package package-to-file; import flixel.graphics.frames.FlxAtlasFrames; import flixel.FlxSprite; import flixel.input.mouse.FlxMouseEventManager; class Card extends FlxSprite { public function new() { super(); FlxMouseEventManager.add(this , onDown, onUp, onOver, onOut); scale.set(0.25, 0.25); addTexture(); } function addTexture() { this.frames = FlxAtlasFrames.fromTexturePackerJson("path-to-atlas.png", "path-to-atla.json"); animation.frameName = "filename-from-atlas"; updateHitbox(); } function onDown(target: FlxSprite) { trace("on down"); } function onUp(target: FlxSprite) { trace("on up"); } function onOver(target: FlxSprite) { trace("on over"); } function onOut(target: FlxSprite) { trace("on out"); } }
This code shows image as it should be 4x smaller but mouse manager functions are called for original size.
-
FlxSprite scale
Hi I used flip card animation from Demo but extra I need to zoom up card after flip.
I have FlxSprite objects with image textures that I load from atlas and set it like thisvar frames: FlxAtlasFrames // this.frames = frames; animation.frameName = label; updateHitbox();
Also it listener target for
FlxMouseEventManager
.
As I need to zoom in to this object I have texture 4x bigger as it is shown on screen initially, so it is not blured when I scale it, at the begining I set scale 0.25 and updatedupdateHitbox()
sprite looked fine on screen but box for listeners is original size so 4x.
I am doing something wrong?Thanx.