Jump to content

[TOPIC: topicViewTemplate]
[GLOBAL: userSmallPhoto]
Photo

Moving objects with magTextureFilter set to nearest problem
Started by JeffreyQJr Jul 12 2013 07:27 PM

1 reply to this topic
[TOPIC CONTROLS]
This topic has been archived. This means that you cannot reply to this topic.
[/TOPIC CONTROLS]
[modOptionsDropdown]
[/modOptionsDropdown]
[reputationFilter]
[TOPIC: post.html]
#1

JeffreyQJr

[GLOBAL: userInfoPane.html]
JeffreyQJr
  • Contributor

  • 140 posts
  • Corona SDK

So to scale up pixel art nicely, i used:

display.setDefault( "magTextureFilter", "nearest" )
display.setDefault( "minTextureFilter", "nearest" )

 

However, when the pixel art/sprite is moving/translate, the pixels will move around (not as smooth as "linear" sampling). Is there a way to smooth things out when moving the art or that is how it works when set to "nearest" sampling?

 

Thanks

- Jeffrey Quek



[TOPIC: post.html]
#2

d.mach

[GLOBAL: userInfoPane.html]
d.mach
  • Contributor

  • 798 posts
  • Corona SDK

I know this was asked a while ago... but nonetheless here is an answer to the problem:

 

You can load images while using "nearest". When images are loaded and scaled you can switch back to "linear" and transitions will be smooth.




[topic_controls]
[/topic_controls]