Jump to content

[TOPIC: topicViewTemplate]
[GLOBAL: userSmallPhoto]
Photo

Problem with object:setFillColor()
Started by c.noeth Aug 12 2016 02:08 AM

5 replies to this topic
setfillcolor problem not working error black color
[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

c.noeth

[GLOBAL: userInfoPane.html]
c.noeth
  • Contributor

  • 218 posts
  • Corona SDK

I just tested a new game on device and noticed some graphics are not colored like they are in the simulator.

I'm using white bitmap images I color with setFillColor to green and in the simulator everything works fine, but on device the graphics are black.

 

Any idea what this can be?

 



[TOPIC: post.html]
#2

bjsorrentino

[GLOBAL: userInfoPane.html]
bjsorrentino
  • Veteran

  • 8,506 posts
  • Corona SDK

Hi @c.noeth,

Can you show a little code around this? Also, what format and size (pixels) are the images? And what device are you testing on?

 

Brent



[TOPIC: post.html]
#3

c.noeth

[GLOBAL: userInfoPane.html]
c.noeth
  • Contributor

  • 218 posts
  • Corona SDK

Here is a snipped of the code:

                    local imagenow = newImage(fontsheet,numbers[c1],framesizeX,framesizeY)
                    charasize=round(imagenow.width*0.85)
                    -- giving the sign a color
                    imagenow:setFillColor (Color_R,Color_G,Color_B)

                    imagenow.alpha=0 -- so we can blend it in later!

                    imagenow.x=(round(charasize))+(txtcounter*charasize)
                    imagenow.y=(round(linenumber*imagenow.height*0.7))

                    imagenow.xScale=0.85
                    imagenow.yScale=0.85
                    
                    sentenceTextArray[x]:insert(imagenow)

                    imagenow=nil

The black letters appear on an iPad with iOS 6.x (can't look it up right now for the exact iOS). But when I remember correctly it also appeared on an iPad 4 running iOS 7.x



[TOPIC: post.html]
#4

bjsorrentino

[GLOBAL: userInfoPane.html]
bjsorrentino
  • Veteran

  • 8,506 posts
  • Corona SDK

Can you upload 2 screenshots that show the difference? That would help me attempt to diagnose this better.

 

Thanks,

Brent



[TOPIC: post.html]
#5

c.noeth

[GLOBAL: userInfoPane.html]
c.noeth
  • Contributor

  • 218 posts
  • Corona SDK

sampletext.jpg

 

Here you can see a screenshot from the test text output in the simulator. It shows the below seen bitmap font (from an image sheet). The image sheet has white letters with a black border and a light grey to white filled area. This letters are colored green as seen in the above code. In the simulator the letters appear green as you can see in the screenshot above. On device the green area of the letters is totally black.

 

Thank you for your help Brent!



[TOPIC: post.html]
#6

c.noeth

[GLOBAL: userInfoPane.html]
c.noeth
  • Contributor

  • 218 posts
  • Corona SDK

Hey Brent,

 

I hope you didn't invest too much time to look into this because it was a mistake by me.

The device used a different language setting and the table I was getting the color info from was not set correctly.

 

Sorry for the hassle. Thanks again for your help!!!




[topic_controls]
[/topic_controls]