PColik Posted November 22, 2014 Share Posted November 22, 2014 Merhaba arkadaşlar. Sizlerden isteğim tam olarak şu: Input1'e sadece 0 ile 100 arası sayı girilebiliyor. Bunun için bana yardımcı olan Ex_treme isimli kullanıcıya teşekkürler. Benim isteğim ise Input1'de ki sayı 0 ila 50 arasında ise Input1 arkaplan rengi kırmızı (#ed1c24), 50 ile 100 arasında ise Input1 arkaplan rengi yeşil (#00a651) olacak. Yardımlarınızı bekliyorum. Teşekkürler... Quote Link to comment Share on other sites More sharing options...
Editor pairs Posted November 22, 2014 Editor Share Posted November 22, 2014 result = Input.GetText("Input1"); if result == "50" then Input.SetProperties("Input1", {BackgroundColor = Math.HexColorToNumber("7fff00")}); end Quote Link to comment Share on other sites More sharing options...
PColik Posted November 22, 2014 Author Share Posted November 22, 2014 (edited) Kardeş vakit ayırdığın için çok teşekkürler ama bu kod ile değer kaç olursa olsun renk yeşil oluyor. Fakat ben başardım sanırım. Belki başkalarınada yardımcı olur. Kod şöyle: giris = Input.GetText("Input1"); if giris == "50" then Input.SetProperties("Input1", {BackgroundColor = Math.HexColorToNumber("00a651")}); end if String.ToNumber(giris) > 50 then Input.SetProperties("Input1", {BackgroundColor = Math.HexColorToNumber("00a651")}); end if giris ~= "50" and giris ~= "" then if String.ToNumber(giris) < 50 then Input.SetProperties("Input1", {BackgroundColor = Math.HexColorToNumber("ed1c24")}); end result = Input.GetText("Input1"); end Bu koda göre Input1'de ki sayı 0 ile 50 arasındaysa kırmızı, 50 ve üzerindeyse yeşil yanar. Edited November 22, 2014 by PColik Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.