Author Topic: How do I get solid color sprite on web browser  (Read 4664 times)

ryuuguu

  • Guest
How do I get solid color sprite on web browser
« on: June 18, 2012, 12:29:04 AM »
I am trying to make a solid background for an area with a sprite. A simple single solid color. It works in the editor but becomes a semi transparent gradient  on browsers (Mac Mini , Safari & Chrome). This happens with both sprite and sliced sprite. "Unlit/Transparent colored overlay" is used. color tint is 0,0,0,255

How does one make a simple solid non-transparent no-gradient sprite background that works on a browser.

ENAY

  • Full Member
  • ***
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 248
    • View Profile
Re: How do I get solid color sprite on web browser
« Reply #1 on: June 18, 2012, 04:29:01 AM »
Looks like a filter trying to blend the edges of your single pixel. Perhaps.

Does it work if you set the properties of the Import setting to "Filter Mode : Point" instead of Bilinear/Trilinear?

Nicki

  • Global Moderator
  • Hero Member
  • *****
  • Thank You
  • -Given: 33
  • -Receive: 141
  • Posts: 1,768
    • View Profile
Re: How do I get solid color sprite on web browser
« Reply #2 on: June 18, 2012, 07:38:07 AM »
A border of 1 px and use a sliced sprite.

ryuuguu

  • Guest
Re: How do I get solid color sprite on web browser
« Reply #3 on: June 23, 2012, 11:55:36 PM »
I ended up combining both. I used pixel on the import and put a 2 pixel border and then used regular sprite. one pixel was not enough.  Still don't know why the shader looks different in editor than browser. Also tried on iPad and shader shows transparent on iPad like browser not solid like editor.

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: How do I get solid color sprite on web browser
« Reply #4 on: June 24, 2012, 12:25:06 AM »
As Nicki said, use a sliced sprite for this. That's what it's designed to do -- allow you to stretch things while still maintaining the way borders look.

Border on import has nothing to do with it, assuming you use a sliced sprite. Leave it at 1. Nicki was talking about a border on the sprite itself. Select the atlas, select the sprite, specify a border of 1.