فهرست منبع

Clarified tint entry in faq

Mikael Säker 7 سال پیش
والد
کامیت
120f281cfc
1فایلهای تغییر یافته به همراه7 افزوده شده و 3 حذف شده
  1. 7 3
      docs/en/faq/faq.md

+ 7 - 3
docs/en/faq/faq.md

@@ -212,12 +212,16 @@ Why am I experiencing visual artifacts around the edges of my sprites?
   Luckily this can be done automatically by the atlas editor in Defold.
   Luckily this can be done automatically by the atlas editor in Defold.
   Open your atlas and set the *Extrude Borders* value to 1.
   Open your atlas and set the *Extrude Borders* value to 1.
 
 
-Can I tint my sprites easily, or do I have to write my own shader for it?
+Can I tint my sprites or make them transparent, or do I have to write my own shader for it?
 
 
-: Yes, you can. The built-in sprite shader has a constant "tint" defined:
+: The built-in sprite shader that is used by default for all sprites has a constant "tint" defined:
 
 
   ```lua
   ```lua
-  sprite.set_constant("#sprite", "tint", vmath.vector4(r, g, b, a))
+  local red = 1
+  local green = 0.3
+  local blue = 0.55
+  local alpha = 1
+  sprite.set_constant("#sprite", "tint", vmath.vector4(red, green, blue, alpha))
   ```
   ```
 
 
 If I set the z coordinate of a sprite to 100 then it's not rendered. Why?
 If I set the z coordinate of a sprite to 100 then it's not rendered. Why?