Welcome, Guest
Please Login or Register.    Lost Password?

[Closed] Skin Question
(1 viewing) (1) Guest
Go to bottomPage: 123
TOPIC: [Closed] Skin Question
#16789
Re:Skin Question 2 Years, 4 Months ago  
Jorge_Luis wrote:
I don't know about ini because I started using Rainlendar with version 2.
But from the original question, there is 1 png for hour and 1 png for seconds or 12 png for hours and 60 png for seconds?


EXACTLY ,here i attached the skin to make it more understandable to know what am after.
nem0
Senior Boarder
Posts: 49
graphgraph
User Offline Click here to see the profile of this user
Gender: Male Birthday: 10/28
Last Edit: 2012/03/06 07:10 By nem0.
The administrator has disabled public write access.
Dont Let UR Dreams be Just .... A DREAMS.
DA
 
#16794
Re:Skin Question 2 Years, 4 Months ago  
I convert the ini skin to the new r2skin format (it's just a zip file but with another extension).
You can find in the script folder a kind of meter.ini and in the xml folder a kind of lendar.ini
It's not a big code. The ini format was dropped in Rainlendar (but works), but it still exists on Rainmeter (that was before my time ).

Install this file with Rainlendar: Timeloid 3D - Rainlendar2 version
Jorge_Luis
Platinum Boarder
Posts: 791
graphgraph
User Offline Click here to see the profile of this user
Gender: Male My Rainlendar Skins Location: Argentina Birthday: 03/15
Last Edit: 2012/03/05 13:12 By Jorge_Luis.
The administrator has disabled public write access.
 
#16795
Re:Skin Question 2 Years, 4 Months ago  
Jorge_Luis wrote:
I convert the ini skin to the new r2skin format (it's just a zip file but with another extension).
You can find in the script folder a kind of meter.ini and in the xml folder a kind of lendar.ini
It's not a big code. The ini format was dropped in Rainlendar (but works), but it still exists on Rainmeter (that was before my time ).

Install this file with Rainlendar: Timeloid 3D - Rainlendar2 version


YOU MAAAAAAAAAAAADE IIIIIIIIIIIIIIIIT ,WTF. ,thanx sooooooo much but yet again i must say HOW U MADE IT WORK that was my first question to learn from it so i can make somethin else or to port somethin harder and as u made it with XML am so lost ,thats why i asked for the ini not the xml ,anyway thanx again.
nem0
Senior Boarder
Posts: 49
graphgraph
User Offline Click here to see the profile of this user
Gender: Male Birthday: 10/28
Last Edit: 2012/03/05 13:33 By nem0.
The administrator has disabled public write access.
Dont Let UR Dreams be Just .... A DREAMS.
DA
 
#16796
Re:Skin Question 2 Years, 4 Months ago  
Unfortunately, the effect you want cannot use ini to work, because (old) ini file cannot support variable, you must use xml + lua to work.
So please refer the skin that Jorge_Luis made.
anoob
Platinum Boarder
Posts: 498
graphgraph
User Offline Click here to see the profile of this user
Gender: Male Location: TaiChung, Taiwan, R.O.C. Birthday: 02/12
The administrator has disabled public write access.
I couldn't speak English! This skin released to Customize.org(Do you want it? Click Picture) Please contact me if interested: jhg5702@gmail.com
 
#16797
Re:Skin Question 2 Years, 4 Months ago  
How it works: (this will be a biiiiiig post )

Code:


--
-- This is the initialization function. It gets called every time Rainlendar
-- is started or refreshed. The initialization function must be defined in the
-- skin file.
--
function Timeloid3D_Initialize(skin, window)
  -- Create a timer which updates the data once per second
  Rainlendar_CreateTimer(1000, Timeloid3D_OnTimer, skin .. "|" .. window)

  -- Run the timer callback so the data is updated immediately
  Timeloid3D_OnTimer(skin .. "|" .. window)
end

--
-- A callback function for the timer. This gets called every time the timer triggers.
-- Returns true so the timer will go on forever (false would stop the timer).
--
function Timeloid3D_OnTimer(userData)
  -- Split the user data
  _, _, skin, window = userData:find("(.*)|(.*)")

  time = os.date("%I:%M:%S")
  _, _, tHour, tMin, tSec = time:find("(%d+):(%d+):(%d+)")
  tHour = tonumber(tHour)
  tMin = tonumber(tMin)
  tSec = tonumber(tSec)
  Rainlendar_SetItemValue(window, "Timeloid3D.hour", "element", "bitmap.h" .. tHour)
  Rainlendar_SetItemValue(window, "Timeloid3D.tens", "element", "bitmap.m" .. math.floor(tMin / 10))
  Rainlendar_SetItemValue(window, "Timeloid3D.minute", "element", "bitmap.mm" .. tMin % 10)
  Rainlendar_SetItemValue(window, "Timeloid3D.second", "element", "bitmap.s" .. tSec)
  Rainlendar_Redraw(0, window)
  return True
end


This is the timeloid.lua file, a LUA script. The first function (Timeloid3D_Initialize) is launched when the window appears (see next, timeloid.xml). It creates a timer which launchs the second function (Timeloid3D_OnTimer) every 1000 ms (like in the meter.ini). The OnTimer reads the current time (os.date) and using Regular Expressions (not too dificult but kind of), it takes the hour, the minute and the second and convert each string (a text) into a number.
Another way is to read the hour, minute and second separately with os.date("%I"), os.date("%M") and os.date("%S"), but you can have something like 1:59:58 -> 1:59:59 -> 1:00:00 -> 2:00:01 if they're not taken at the same time. (you take the hour just a moment before the change to 2).
The ".." concatenates strings. And with the SetItemValue (you can find more info in the Rainlendar Help) it changes the value of e.g. "element" of the item called "Timeloid3D.hour". And then, redraws the window (every second a new picture).

The values for the element tag are stored in xml/elements.xml
Code:


<?xml version="1.0" encoding="UTF-8" ?>
<skin version="1.0">
  <elements>
    <bitmap id="bitmap.h0" file="images/h0.png" />
    ...
    <bitmap id="bitmap.h12" file="images/h12.png" />
    <bitmap id="bitmap.mm0" file="images/mm0.png" />
    ...
    <bitmap id="bitmap.mm12" file="images/mm12.png" />
    <bitmap id="bitmap.m0" file="images/m0.png" />
    ...
    <bitmap id="bitmap.m12" file="images/m12.png" />    
    <bitmap id="bitmap.s0" file="images/s0.png" />
    ...
    <bitmap id="bitmap.s59" file="images/s59.png" />
    <bitmap id="bitmap.secsshadow" file="images/secsshadow.png" />
    <bitmap id="bitmap.shadow" file="images/shadow.png" />
  </elements>
</skin>


Each image must have an identifier. Because of the pattern, I can change the values of the element tag.

Now comes the window, timeloid.xml:
Code:


<?xml version="1.0" encoding="UTF-8" ?>
<skin version="1.0">
  <window id="Timeloid 3D" w="442" h="785" threshold="48" default="0" oncreate="Timeloid3D_Initialize('#SKIN#', '#ID#')">
    <image id="Timeloid3D.shadow" x="0" y="590" element="bitmap.shadow" />
    <image id="Timeloid3D.hour" x="20" y="0" element="bitmap.h0" />
    <image id="Timeloid3D.tens" x="40" y="189" element="bitmap.m0" />
    <image id="Timeloid3D.minute" x="0" y="365" element="bitmap.mm0" />
    <image id="Timeloid3D.secsshadow" x="235" y="394" element="bitmap.secsshadow" />
    <image id="Timeloid3D.second" x="246" y="455" element="bitmap.s0" />
  </window>
</skin>


When the window is created (oncreate) it launchs the first function of this post.
Then, one by one, each image that composes the window. (I use .h0, .m0, .mm0 and .s0 by default)
The order matters, that's way I put the secsshadow before the second but after the minute.

You can find these files renaming the extension from .r2skin to .zip and opening it with any app.
If you want to port any other skin, you will need to check every skin (start with Shadow4.r2skin). When I start to use Rainlendar2, I didn't know anything about LUA or XML (a little of XML). But you will need a little experience on C language (from LUA comes).


There is a "better" way, with less lines, but you need to put all the hours in 1 file, one next the other. You will have a image with e.g. 12 frames (1 -> 12), and with the <time> item, you can "do" something automatic.
Jorge_Luis
Platinum Boarder
Posts: 791
graphgraph
User Offline Click here to see the profile of this user
Gender: Male My Rainlendar Skins Location: Argentina Birthday: 03/15
Last Edit: 2012/03/05 16:16 By Jorge_Luis.
The administrator has disabled public write access.
 
#16802
Re:Skin Question 2 Years, 4 Months ago  
THAT just gave me a big headache ,does the "BETTER WAY" involves xml and lua also or it could be done differently ,could it be applied on the other skin ?
nem0
Senior Boarder
Posts: 49
graphgraph
User Offline Click here to see the profile of this user
Gender: Male Birthday: 10/28
The administrator has disabled public write access.
Dont Let UR Dreams be Just .... A DREAMS.
DA
 
Go to topPage: 123
get the latest posts directly to your desktop