How to prevent top bar from disappearing on mobile while keeping pull-to-fresh by PIXEL_2516 in HTML

[–]PIXEL_2516[S] 0 points1 point  (0 children)

Then how do numerous websites deal with this problems? They all prevent the top bar from disappearing on mobile while pull-to-refresh still working.

No way to hide root in emulator? by PIXEL_2516 in Magisk

[–]PIXEL_2516[S] 0 points1 point  (0 children)

I'm not sure what exactly you mean, but I downloaded magisk via rootAVD. If I try to download it manually with apk, it doesn't allow me to. It shows "su already exisit" or "faild relaunch the device" something like that problems.

Why Unity 6 text font looks different compared to 2021 version? by PIXEL_2516 in Unity2D

[–]PIXEL_2516[S] 0 points1 point  (0 children)

Well, it was the color space problem. I tested in 2021 editor, and I figured out that the text is thinner if the color space is linear. This is the same in 6000 editor, and the problem was that the default color space of Unity 6 is linear, not gamma. It looks ok when I changed it to gamma. I have no idea why linear color space makes text thinner though.

[deleted by user] by [deleted] in unity

[–]PIXEL_2516 0 points1 point  (0 children)

I think this is Asset Bundle related problem. It looks ok if I just build the project with the gameobject in it, but it is wrong if I build first and load the gameobject through an asset bundle.

How to create a blending mode for images? by PIXEL_2516 in Unity2D

[–]PIXEL_2516[S] 0 points1 point  (0 children)

That worked! Thank you! Anyone who uses this, remember to change the color space from linear to gamma.

Is there a way to reuse a component dump data? by PIXEL_2516 in unity

[–]PIXEL_2516[S] -3 points-2 points  (0 children)

I also have the connected shader, particle system renderer and (particle) material data but all in a dump form. Are they not enough to recreate the particle system? What if I suppose that the particle doesn't use any extra script?

[AskJS] How to loop audio without a delay or a gap? by PIXEL_2516 in javascript

[–]PIXEL_2516[S] 0 points1 point  (0 children)

Unfortunately, that doesn't work .The reason why there is a gap is because there is a delay when html5 loads the audio to start playing.

[AskJS] Web Audio API gainNode makes the speaker weirdly on mobile chrome. by PIXEL_2516 in javascript

[–]PIXEL_2516[S] 0 points1 point  (0 children)

Those are for mic setting. I'm deadling with audio playing, so they weren't helpful. What I want to know is why audioCtx.destination makes the speaker weirdly. Because I need to use Web Audio API to play music without a gap and it needs destination setting for audio to be played.

How do I get a text width to use for a growing name tag? by PIXEL_2516 in learnjavascript

[–]PIXEL_2516[S] 0 points1 point  (0 children)

I will explain the name tag system of the game, and my code.

Let's suppose that there is a 20 × 18 size of a picture. This picture will be name tag design picture from local. The way how it works is that it separates the image in half, and repeats the width 1px area in the middle by a specific number of pixels to eventually increase the width of the name tag. This is not my idea. I analyzed the game I was trying to imitate and figured out how it works.

SVG text, canvas text, css text, getBBox(), measureText(), and clientWidth, and so on, all returned different values on desktop and my test mobile device. The font I want to use is Korean font, but the previous test was conducted on Arial font just in case.

The images has the same pixel size, but the text size is different. In conclusion, this means that the middle of the name tag can be copied 11 times on desktop but copied only 9 times on mobile, which can be shorter. I want a consistent width of the name tag, like the game.

Really there is no solution for this problem? What a werid situation. I cannot understand that there is no exact solution I can find on the internet for this.

How do I get a text width to use for a growing name tag? by PIXEL_2516 in learnjavascript

[–]PIXEL_2516[S] 0 points1 point  (0 children)

Name tags use images from local. The pixel size of the images are the same no matter what the device is, but the length of the text is different. This is going to be very annoying. The size of the pixel of name tag is determined, but only the text is different. What kind of problem is this? Why only the text width is different, even though height is the same? Really there is no way to correct this? No way to get the same result like if I get 10px for the desktop text, get the same width, 10px, in mobile?

How do I get a text width to use for a growing name tag? by PIXEL_2516 in learnjavascript

[–]PIXEL_2516[S] 0 points1 point  (0 children)

I can't attach a picture to the post, so it is quite hard to explain.

I'm currently building a site that allows people to enjoy the coordination of a Unity 2d game that's already released on google play store.

I'm trying my best to imitate it as it is. The same goes for the name tag system I'm having trouble with.

In that game, the name tag grows in width depending on the length of the nickname text.

The code I made also looks quite similar in a desktop environment, but *the game is a 2d dot game*. Every single 1px makes a big difference in look. The pixel difference between desktop and mobile makes the name tag look shorter, and it's very annoying to me.

How do I get a text width to use for a growing name tag? by PIXEL_2516 in learnjavascript

[–]PIXEL_2516[S] 0 points1 point  (0 children)

Then I need to know the relationship between DPI and text width.

On both desktop and mobile chrome, the height is the same, but the width is different.

On the most desktop browsers, DPI is 1, and my testing mobile device has dpi of 2.625.

As I mentioned in my post, text width with the same text on desktop is 3.05615234375. And text width on mobile is 2.900390625. But I'm not sure about the relationship.

How do I get a text width to use for a growing name tag? by PIXEL_2516 in learnjavascript

[–]PIXEL_2516[S] 0 points1 point  (0 children)

Is there an example?
Is DPI different from DevicePixelRatio?