Welcome, Guest
Please Login or Register.    Lost Password?

Changing element color and Rainlendar_Redraw
(1 viewing) (1) Guest
Go to bottomPage: 1
TOPIC: Changing element color and Rainlendar_Redraw
#24840
Changing element color and Rainlendar_Redraw 1 Month, 1 Week ago  
Why does the following script not work?

Code:

<solid id="color.health" color="0,200,0,200" />


Code:

function testMe()
Rainlendar_SetElementValue("mySkin","color.health","color","200,0,0,200")
Rainlendar_Redraw(1)
Rainlendar_Message("Finished",4)
end



While the appearing message box suggests, that the script changed the color of the element, the change isn't displayed in the skin.
BigMike
Junior Boarder
Posts: 30
graphgraph
User Offline Click here to see the profile of this user
Last Edit: 2017/12/14 05:24 By BigMike.
The administrator has disabled public write access.
 
#24842
Re:Changing element color and Rainlendar_Redraw 1 Month, 1 Week ago  
I agree, it seems to have some problem and cannot find the reason.

My workaround: (use Rainlendar_SetItemValue)
Code:

  <solid id="solid.bg.red" color="200,0,0,200"/>
  <solid id="solid.bg.green" color="0,200,0,200"/>



Code:

function mySkin_call()
  txt = Rainlendar_GetItemValue("mySkin","mySkin.bg","element")
  if txt == "solid.bg.red" then
     Rainlendar_SetItemValue("mySkin","mySkin.bg","element","solid.bg.green")
   else
     Rainlendar_SetItemValue("mySkin","mySkin.bg","element","solid.bg.red")
  end
 Rainlendar_Redraw(1, "mySkin")
end

keepstudy
Expert Boarder
Posts: 132
graphgraph
User Offline Click here to see the profile of this user
Gender: Male Location: Taiwan
The administrator has disabled public write access.
Native Language: Chinese
Email: jhg5702@hotmail.com
 
#24843
Re:Changing element color and Rainlendar_Redraw 1 Month, 1 Week ago  
I already thought about this.
But I actually intended to use the "status color" in more than one place.
While changing the element itself would require one change in one place, I would need to touch various elements all over my windows That's a bit ugly...

Thank you again for your help
BigMike
Junior Boarder
Posts: 30
graphgraph
User Offline Click here to see the profile of this user
Last Edit: 2017/12/15 03:50 By BigMike.
The administrator has disabled public write access.
 
#24846
Re:Changing element color and Rainlendar_Redraw 1 Month, 1 Week ago  
Have you think: try to change the element of "bitmap".

That is, create some bitmap (can 1x1) by yourself, ex "red.jpg" "green.jpg", then use Rainlendar_SetElementValue to toggle them.
keepstudy
Expert Boarder
Posts: 132
graphgraph
User Offline Click here to see the profile of this user
Gender: Male Location: Taiwan
The administrator has disabled public write access.
Native Language: Chinese
Email: jhg5702@hotmail.com
 
#24847
Re:Changing element color and Rainlendar_Redraw 1 Month, 1 Week ago  
No, I didn't think about that. I'll try it. Thank's
BigMike
Junior Boarder
Posts: 30
graphgraph
User Offline Click here to see the profile of this user
The administrator has disabled public write access.
 
Go to topPage: 1
get the latest posts directly to your desktop