GL_NEAREST instead of GL_LINEAR

Hi Richard9, I’m using the following code, can’t seem to find any problem in the following code:

local sheetInfo = require("Episode1.1.frogFrames")  
  
--graphics.setDefault( "minTextureFilter", "nearest" )  
--graphics.setDefault( "magTextureFilter", "nearest" )  
  
local myImageSheet = graphics.newImageSheet( "Episode1/1/frogFrames.png", sheetInfo:getSheet() )  
  
local sequenceData = {  
 { name="jump", frames={1,2,1}, loopCount=1, time = 100 },  
 { name="lick", frames={ 1,3,1}, time=50, loopCount=4 },  
}   
  
display.setDefault( "minTextureFilter", "nearest" )  
display.setDefault( "magTextureFilter", "nearest" )  
avatar = display.newSprite( myImageSheet, sequenceData )  
--avatar = display.newImageRect(group2,"Episode1/1/images/frog.png", 60,60)  
avatar.xScale = 4  
avatar.yScale = 4  

If I’m doing something wrong here I’d be very grateful for a point in the right direction. When I uncomment the newImageRect line - it works perfectly, just can’t get display.newSprite to work accurately. [import]uid: 33275 topic_id: 35825 reply_id: 143559[/import]

Just tried to pull out a static image from the imageSheet with the following code, and still getting a blurred image ?!?!

  
local sheetInfo = require("Episode1.1.frogFrames")  
  
--graphics.setDefault( "minTextureFilter", "nearest" )  
--graphics.setDefault( "magTextureFilter", "nearest" )  
  
local myImageSheet = graphics.newImageSheet( "Episode1/1/frogFrames.png", sheetInfo:getSheet() )  
  
local sequenceData = {  
 { name="jump", frames={1,2,1}, loopCount=1, time = 100 },  
 { name="lick", frames={ 1,3,1}, time=50, loopCount=4 },  
}   
  
display.setDefault( "minTextureFilter", "nearest" )  
display.setDefault( "magTextureFilter", "nearest" )  
avatar = display.newImage( myImageSheet, 1 )  
--avatar = display.newSprite( myImageSheet, sequenceData )  
--avatar = display.newImageRect(group2,"Episode1/1/images/frog.png", 60,60)  
avatar.xScale = 4  
avatar.yScale = 4  

So to summarise:

I can correctly display a scaled up pixeled graphic using avatar = display.newImageRect(group2,“Episode1/1/images/frog.png”, 60,60).

I can’t create an animated sprite and scale it up.

I can’t get a static image out of the imageSheet and scale it up.

Must be doing something really wrong. [import]uid: 33275 topic_id: 35825 reply_id: 143561[/import]

*Duplicated post* [import]uid: 33275 topic_id: 35825 reply_id: 143562[/import]

Maybe a Corona dev can chime in, because your code looks mostly right. The fact that it still blurs means that it’s likely an order issue. Perhaps your getSheet() code is trying to scale something before it gets to display.newSprite? What happens if you move setDefault to the top of that code sample?

(Oh, and are you using 1031?) [import]uid: 41884 topic_id: 35825 reply_id: 143577[/import]

Apologies - I have this all working now, damn forward reference was cancelling out something :slight_smile:

Thanks for your input. [import]uid: 33275 topic_id: 35825 reply_id: 143587[/import]