Jump to content

[TOPIC: topicViewTemplate]
[GLOBAL: userSmallPhoto]

display.captureBounds makes fonts blurry
Started by CoronaChris Nov 02 2018 01:23 AM

1 reply to this topic
[TOPIC: post.html]


[GLOBAL: userInfoPane.html]
  • Contributor

  • 162 posts
  • Corona SDK

Dear Corona-community,


to save memory-usage in my emojiText-module, I'd like to take a snapshot of my display.newText and display.newImageRect - elements and replace those elements with that snapshot.


Unfortunately display.captureBounds produces this (Screenshot on Android device):


Attached File  captureBounds.jpg   82.39KB   0 downloads


Top: Display.newText() elements for each word

Bottom: Snapshot of it


Is there anything I can do about it to make them look the same?



[TOPIC: post.html]


[GLOBAL: userInfoPane.html]
  • Contributor

  • 162 posts
  • Corona SDK

Using display.capture makes it a little bit smoother, but still not acceptable:


Attached File  capture.jpg   53.14KB   0 downloads



/edit: Ok, saving a capture on the device via display.save(captureGroup, ...) and then retreiving it by display.newImageRect returns a perfect sharp font. I am just a little worried since I have scenes where I have to rerender multiple texts with emojis, so I'd get like 20-30 of those captured images.


To make things easier: Let's say I have ten input strings:

"Hello :) This is a text with two emojis :) "


If I rerender them via my emojiText - module, I'd get eight display.newText() - elements (one for each word) and two display.newImageRects(), so ten elements in total for one string.


Multiplied by ten strings I'd get 100 single elements to rerender my input strings that include emojis.


Now, if I capture each of those ten input strings by using display.save(captureGroup), remove those temporalily created 8 display.newText() and 2 imageRects and instead show only this snapshot, I'd have ten displayobjects on screen, but each one was created by saving a screenPortion to deviceStorage and reloading it.


Any comments which way is the better one? :)