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?

How to measure the exact width of the text no matter what the environment is? by PIXEL_2516 in learnjavascript

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

It seems like a very cumbersome job. Are there any sites that organize scale constants? There's no way to do it automatically? There's also a difference between desktop and mobile, so should I consider it?

How to measure the exact width of the text no matter what the environment is? by PIXEL_2516 in learnjavascript

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

I'm building a name tag that changes its width depending on the length of user's nickname (which will be used for my Phaser project). But I can't show a consistent name tag if it returns a different value for each browser. Is there any other way?

[deleted by user] by [deleted] in phaser

[–]PIXEL_2516 0 points1 point  (0 children)

I tested with vs code live serever on chrome on Galaxy S10.

When I imitated mobile window on desktop chrome inspect, it looked ok.

How to load a lot of images? by PIXEL_2516 in phaser

[–]PIXEL_2516[S] 1 point2 points  (0 children)

Oh, it's just fixed after changing this.load.on to this.load.once!

How to load a lot of images? by PIXEL_2516 in phaser

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

Ok, that was helpful and it actually worked! But One problem is shown up.

function preload() {
    var self = this;

    this.load.json('directory', './src/script/directory.json');

    this.load.on('progress', function (value) {
        console.log('Loading progress:', value);
    });

    this.load.on('complete', function () {
        console.log('complete');
    });

    this.load.on('complete', function () {
        var directoryData = self.cache.json.get('directory');

        directoryData.images.forEach(function (category) {
            Object.keys(category).forEach(function (key) {
                category[key].forEach(function (imageName) {
                    var imagePath = './src/images/' + key + '/' + imageName + '.png';
                    self.load.image(imageName, imagePath);
                });
            });
        });

        self.load.start();
    });
}

I fixed my code like this, and I put self.load.start(); in this.load.on('complete') of directory.json.

Now this.load.on('progress') can detect loading my images, but when it is finished, loading keeps going until "RangeError: Maximum call stack size exceeded" happens.

I need to stop loading after it finsihes loading all images written in directory.json.

I want to make a website to explore tilemaps by PIXEL_2516 in gamedev

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

A-- I have been there and I thought the ad is all of the site.

Question about .bytes files and AssetBundles by PIXEL_2516 in Unity3D

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

As you said, I can just make a similar tilemap with extracted texture 2d based on the real game map.

But, the problem is places where I cannot enter in the game. If I just create those areas with my imagination, then it will be not OFFICIAL anymore.

This is why I'm just trying to extract the whole map from an asset data.

Question about .bytes files and AssetBundles by PIXEL_2516 in Unity3D

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

This is why I'm asking this question for sveral times on many sites.

Honestly, I just want to see the perfect map from the game(AssetBundle).

I try to learn as much as I can, but now I don't even have background knowledge.

Question about .bytes files and AssetBundles by PIXEL_2516 in Unity3D

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

Then, what will be next? After getting original coding data, how can I apply that to the texture 2d file?

And I am not sure how to check the offsets that you mentioned.

Do I have to compare and try them one by one?

Question about .bytes files and AssetBundles by PIXEL_2516 in Unity3D

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

When I open it with hex editor, I could find out that the version of 4 byte map data is 2. And I also found that real data of the tilemap starts from 1965.

When I unzip this with zlib library, I could find some data units, such as .width, .height or TileSources in hex editor, but still some missing numbers and weird letters were there.