Pixi: SVG not scaling as expected - pixi.js

The following link demonstrates the issue:
When using the beeSvg as the source, changing scales changes the resolution of the sprite as it should.
When using the custom simpleIcon as the source, the sprite instead is cut off.
https://www.pixiplayground.com/#/edit/pkT96MYIfGmkiYwjtgvGT

Related

How Can I Fix Inconsistent Text Downscaling with a Rich Text Label In Godot?

I have a rich text label that works fine under a resolution of 1920x1080. However, when scaled down to the resolution on my laptop, which has a 1366x768 resolution, the text on said label becomes janky and malformed.
Some lines are cut off at the top or the bottom, and others are squished (as you can see in the image at lines 3, 6, and 13).
I'm using Godot v3.5.1 and the text font is Noto Sans Regular from here
I tried enabling mipmaps, using the filter, disabling anti aliasing, disabling font oversampling and enabling GPU pixel snap under Project Settings > Rendering > 2D > Snapping. And out of all of those, only the pixel snap setting worked. Completely fixes the issue and the text is rendered properly.
However, this completely breaks an animation of a spinning circle that plays at basically all times during the actual gameplay. It becomes stuttered and shakes instead of the normally smooth animation it has otherwise. I realize this may possibly be fixed by using SVG instead of PNG sprites, but I feel like that's not an ideal solution in case other sprites get added. Especially since my game will also allow community members to add their own sprites for their own game play.
So is there any way to fix the text without breaking the animations, or make it so that the animations don't break with pixel snap enabled?

SVG as texture gets blended in some way

I've got a strange behaviour when using SVG as textures in three.js.
When loading the first texture all is fine but the second one contains the first one when used as a texture (they share the same viewBox in the SVG but that shouldn't be an issue normally). Stuff is working when using PNGs or other image files.
Here is a minimal example:
http://jsbin.com/xeyigahata/1/edit?html,js,output
Thx!

android wipe animation when button bar slide up

I'm trying to create slidingup animation in android application to change between two view of layout.
I've tried from this tutorial
but the second screen didn't come like what I want.
I want the second layout to come like a wipe animation, like the following picture at the bottom
Refer this:
https://android.googlesource.com/platform/frameworks/base/+/ab51002847ea3dcdc0ba14eb330ab9ec292a9789/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java
In the above code, focus on the animateCollapsePanels method
I was able to implement a similar transition by using a clipping Path. Because I didn't want my transition to rule out the use of Layouts in the clipped view, I implemented the clipping at the Layout level following this answer: Custom Layout that rounds the corners of its content
The clipping is no anti-aliased and you would need to do use instead PorterDuff and XferMode based solutions otherwise, but for a linear wipe animation like you're describing, clipping in the layout will achieve what you want. Basically you're doing a linear reveal whereas the accepted answer I linked does a circular clip.

how can one resize portions of a css-sprite?

I'd like to improve upon jQuery's dialog code by using CSS-sprites, and thus also add animations of the dialog borders.
To do this, i'd like all the artwork to be in 1 png file, a css sprite.
My problem is that in order to support a dialog that maximizes to 2 or 3 monitors, i think i'd have to put 5000px wide / high border graphics in the css sprite file. Because i can't find a way to resize a selected portion of a css sprite image.
Basically i want to resize from the sprite image a region (t,l,w,h) to a DIV or IMG on my page with a different width and height.
I'd like to know, is this even possible? It seems background-position does not support this at all.
I've tried the first solution in How can I scale an image in a CSS sprite, but could not get it to work using that.
I've tried using the new background-size property in conjunction with background-position, but that also does not produce the results i want.
Spent another few hours twiddling with css, but could not get sprites to work for dialogs.
But my animated dialogs don't need many frames (not unless you want to put actual video as a dialog backdrop online), so for the dialog theme i'm designing now i have 8 312x312 png's as frames, 8 requests, 386kb total. Just enough to create a glowing animation for when the dialog is in a "highlighted" state. It's do-able.
I'm using the technique from How can I scale an image in a CSS sprite
See http://mediabeez.ws in about a month for the opensource release of animated dialogs.
I will be developing and testing this standalone component when it's used by my own homegrown CMS, so it will have the ability do be themed, dragged and dropped, things like that.

Not able to get stencil to work

Was trying to get Stencil to work in my app. I use Sprites to render content on to the Device. Content could be movies, pictures or text.
Can I set the stencil buffer using these Sprites, which can be used in later passes to stencil out other Sprites being rendered?
I'm even not able to stencil out any of the Sprites by setting StencilFunction = Compare.Never! Anything wrong that I might be doing?
I've already spent almost an entire day checking out posts related to Stencils in MDX, but just couldn't get it to work.
Bit more searching got me to a technique wherein we draw silhouette of the shapes to be added to the stencil buffer. Is this really required in my case? I just want to use the Sprites, and add them to stencil buffer to stencil out other Sprites.
EDIT: OK.. So I figured out how to get it done. Referred to this post - http://www.gamedev.net/community/forums/viewreply.asp?ID=1999276
But now the sprite is ignoring alpha values and rendering sprites opaque. Similar to the effect we get when alpha blending is set to false. Any ideas?
So, I finally figured it out. It's all related to Sprites and its Begin() method.
Sprite.Begin() will modify the RenderState and disable stencil. We can prevent it by setting SpriteFlags.DoNotModifyRenderState flag, but then the alpha blending is not supported when sprites are drawn.
What I did now was simply call Sprite.Begin() without SpriteFlags.DoNotModifyRenderState flag set. And before the call to Sprite.Draw(), enabled stencil on the device.

Resources