.
Do I need to set the corresponding “1x 2x 3x” texture when enabling high “dpi”?
.
In the goal of “openfl starling html5”, I have a bitmap text. Because I need to display text with a size of 14, I made the bitmap text twice as large, 14x2=28. The font size of the bitmap I made is 28. When displaying text, I set the text size to 14. It looks clear on the computer, but the bitmap text appears blurry on the phone.
.
Starling. current. contentScaleFactor "returns 1 on my computer and 4 on my phone.
.
Do you need to create a “1x 2x 3x” texture and select the corresponding texture through “Starling. current. contentScaleFactor”?
.
Can everyone talk about their experience?
.
Hi @785597448. When working on another project today, I came across this bit of information and thought of you.
This discusses how you might use the contentScaleFactor dynamically, in conjunction with assets created for higher resolutions, such as the “4 on my phone” you mentioned.
In terms of my experience (you asked), most of my Starling projects are designed to be run on specific systems with pre-determined resolutions, so I rarely have to deal with scaling variations.
When I’ve needed to cater to varying resolutions, such as when targeting HTML5, I typically drop Starling and use OpenFL with SVG’s instead, as these naturally scale without issue, being vector. So far none of those HTML5 projects have been games though, so different needs I guess.
If what I was creating required sprite animations and such, I’d likely persist with Starling when targeting HTML5.
.
I have always thought that you use “Starling” to develop “HTML5” applications, but you replied that if you develop “HTML5” applications, you will give up “Starling”.
.
As far as I know, the performance of ‘SVG’ is very poor! As you can see, it has poor performance due to its’ vector shape ‘.
.
I have read that article and it uses’ contentScaleFactor 'to select the corresponding texture
.
My response was only speaking from my experience, which is based on the projects I’ve been contracted to deliver.
Yes, if I was seeking to maintain performance and access to sprite based animations, such as a game, I would not give up on Starling when targeting HTML5. There are use cases where I would persist with Starling when targeting HTML5.
I was not making a broad statement that Starling should not be used for HTML5. Only, that I have not yet needed it when targeting HTML5.
Yes, I think that could be handy. So having assets in respective folders labelled something like 1x, 2x, 3x and 4x. You don’t necessarily have to specify all of them, but that’s something you might handle with a switch statement, with a default fallback.
Yes, I agree it’s something to be mindful of. The HTML5 projects I’m referring to, were largely static and relatively un-complex interfaces, at least as far as the SVG’s were concerned.
For this purpose, it was not an issue.
Doesn’t your ‘html5’ project require rendering a large number of animations simultaneously?
I don’t recall ever making that claim, so perhaps there’s been a simple misunderstanding.
I have many Starling projects over the years targeting Windows, and more recently Linux and a small number of native mobile apps, and yes, some of these have leveraged many thousands of frames of sprite animations. I used one of these as a reference in our discussions a month or two ago. That was a project targeting a Windows content server driving a huge LED installation.
Maybe I tested this in HTML5, as a test case when giving you a hand with HTML5 questions, I can’t recall, but the projects intended target was native Windows.
