And Another Clock

Post those lines of code you feel like sharing or find what you require for your project here; or simply use them as tutorials.
Acki
Posts: 3496
Joined: Tue Jun 29, 2004 12:04 am
Location: Nobody's Place (Venlo NL)
Contact:

And Another Clock

Post by Acki »

Hi,
because there are already clock nodes/elements posted in the forum I decided to post mine, too... ;)

it's the very first version and has not many features though...
there are 2 clocks, a gui clock and a scene clock (node)...

I made them for my IrrExtensions and they are already finished and they have many, many features...
check out my IrrExtensions for the final versions !!! ;)

download demo & source: ClockNode.7z
Image
Last edited by Acki on Tue Jun 23, 2009 2:11 am, edited 1 time in total.
while(!asleep) sheep++;
IrrExtensions:Image
http://abusoft.g0dsoft.com
try Stendhal a MORPG written in Java
BlindSide
Admin
Posts: 2821
Joined: Thu Dec 08, 2005 9:09 am
Location: NZ!

Post by BlindSide »

The clocks look nice. But what horrible image downsizing program did you use?
ShadowMapping for Irrlicht!: Get it here
Need help? Come on the IRC!: #irrlicht on irc://irc.freenode.net
Acki
Posts: 3496
Joined: Tue Jun 29, 2004 12:04 am
Location: Nobody's Place (Venlo NL)
Contact:

Post by Acki »

BlindSide wrote:The clocks look nice.
thx ;)
BlindSide wrote:But what horrible image downsizing program did you use?
well, I use PaintShopPro 6 and scaled the image to 75%...
I think I used a bad anti alias setting (or even non) !?!?! :P
while(!asleep) sheep++;
IrrExtensions:Image
http://abusoft.g0dsoft.com
try Stendhal a MORPG written in Java
Dorth
Posts: 931
Joined: Sat May 26, 2007 11:03 pm

Post by Dorth »

nearest neighboor maybe?
Acki
Posts: 3496
Joined: Tue Jun 29, 2004 12:04 am
Location: Nobody's Place (Venlo NL)
Contact:

Post by Acki »

better now !?!?! :lol:
while(!asleep) sheep++;
IrrExtensions:Image
http://abusoft.g0dsoft.com
try Stendhal a MORPG written in Java
Midnight
Posts: 1772
Joined: Fri Jul 02, 2004 2:37 pm
Location: Wonderland

Post by Midnight »

It's always nice to see spinoffs of my projects turn into something official.

8)
Acki
Posts: 3496
Joined: Tue Jun 29, 2004 12:04 am
Location: Nobody's Place (Venlo NL)
Contact:

Post by Acki »

well, it was not inspired by your clock...
I already worked some time on it, before you started your thread...
the demo and source is just my very first attempt and it's a remake so it doesn't depend on other Extensions (what the final version does), so anybody can use it...
when I release the final clock, you'll see how many work was involved !!! ;)

just some keywords:
use real time/date or game time/date
sync clocks with another clock
use different fonts for any digital representation
use textures for all gui clock elements (body and needles)
show digital clock as 12h or 24h clock
shows day name of any date you set
completely serialized (load/saveScene and load/saveGUI)

(argh, date reminds me to implement one final feature: negative years shall be shown with "bc", currently they are just negative)

and here the lists of all (public) functions so you can have an overview...
GUI-Clock:

Code: Select all

    virtual void setBodyTexture(video::ITexture* texture);
    virtual void setNeedleTexture(video::ITexture* txtH, video::ITexture* txtM, video::ITexture* txtS);
    virtual void setSize(core::dimension2d<s32> size);
    virtual void setPosition(core::position2d<s32> pos);
    virtual void setRect(core::rect<s32> rect);
    virtual void setTime(u32 h, u32 m, u32 s);
    virtual bool getGameTimeIsAM();
    virtual void setShowAnalogSeconds(bool showS);
    virtual bool getShowAnalogSeconds();
    virtual void setShowDigitalSeconds(bool showS);
    virtual bool getShowDigitalSeconds();
    virtual void setUseRealTime(bool useRT);
    virtual bool getUseRealTime();
    virtual void setIs12hClock(bool use12h);
    virtual bool getIs12hClock();
    virtual void setAutoUpdate(bool doAU);
    virtual bool getAutoUpdate();
    virtual void setGameDate(s32 y, u32 m, u32 d);
    virtual void setGameDateYear(s32 y);
    virtual s32 getGameDateYear();
    virtual void setGameDateMonth(u32 m);
    virtual u32 getGameDateMonth();
//
    virtual s32 getWeekDay(s32 y, u32 m, u32 d);
    virtual core::stringc getWeekDayName(s32 y, u32 m, u32 d);
    virtual core::stringw getWeekDayNameW(s32 y, u32 m, u32 d);
//
    virtual core::stringc getGameDateMonthS();
    virtual core::stringw getGameDateMonthW();
    virtual void setGameDateMonthDay(u32 d);
    virtual u32 getGameDateMonthDay();
    virtual u32 getGameDateWeekDay();
    virtual core::stringc getGameDateWeekDayS();
    virtual core::stringw getGameDateWeekDayW();
    virtual core::stringc getGameDateString();
    virtual core::stringw getGameDateStringW();
//
    virtual void movePositionDateTo(core::position2di p);
    virtual void setDateFonts(IGUIFont* f1, IGUIFont* f2, IGUIFont* f3, IGUIFont* f4);
//
    virtual void setShow_DayName(bool s);
    virtual bool getShow_DayName();
    virtual void setFont_DayName(IGUIFont* f);
    virtual IGUIFont* getFont_DayName();
    virtual void setPosition_DayName(core::position2di p);
    virtual core::position2di getPosition_DayName();
    virtual void setColor_DayName(video::SColor c);
    virtual video::SColor getColor_DayName();
//
    virtual void setShow_Day(bool s);
    virtual bool getShow_Day();
    virtual void setFont_Day(IGUIFont* f);
    virtual IGUIFont* getFont_Day();
    virtual void setPosition_Day(core::position2di p);
    virtual core::position2di getPosition_Day();
    virtual void setColor_Day(video::SColor c);
    virtual video::SColor getColor_Day();
//
    virtual void setShow_Month(bool s);
    virtual bool getShow_Month();
    virtual void setFont_Month(IGUIFont* f);
    virtual IGUIFont* getFont_Month();
    virtual void setPosition_Month(core::position2di p);
    virtual core::position2di getPosition_Month();
    virtual void setColor_Month(video::SColor c);
    virtual video::SColor getColor_Month();
//
    virtual void setShow_Year(bool s);
    virtual bool getShow_Year();
    virtual void setFont_Year(IGUIFont* f);
    virtual IGUIFont* getFont_Year();
    virtual void setPosition_Year(core::position2di p);
    virtual core::position2di getPosition_Year();
    virtual void setColor_Year(video::SColor c);
    virtual video::SColor getColor_Year();
//
    virtual void setSecondsForDay(f32 secs);
    virtual f32 getSecondsForDay();
    virtual void setMinutesForDay(f32 mins);
    virtual f32 getMinutesForDay();
    virtual void setHoursForDay(f32 hrs);
    virtual f32 getHoursForDay();
    virtual void setSecondsForHour(f32 secs);
    virtual f32 getSecondsForHour();
    virtual void setSecondsForMinute(f32 secs);
    virtual f32 getSecondsForMinute();
    virtual void setUpdatesPerSecond(f32 upd);
    virtual f32 getUpdatesPerSecond();
    virtual void setSyncClock(IGUIClock* clock);
    virtual void setSyncClock(scene::IClockSceneNode* clock);
    virtual IGUIClock* getSyncGUIClock();
    virtual scene::IClockSceneNode* getSyncSceneClock();
    virtual u32 getGameTimeHours();
    virtual u32 getGameTimeMinutes();
    virtual u32 getGameTimeSeconds();
    virtual f32 getGameTimeHoursFloat();
    virtual f32 getGameTimeMinutesFloat();
    virtual f32 getGameTimeSecondsFloat();
    virtual core::stringc getGameTimeString();
    virtual core::stringw getGameTimeStringW();
//
    virtual void setIsPaused(bool p);
    virtual bool getIsPaused();
    virtual void setSmoothMovement(bool sm);
    virtual bool getSmoothMovement();
    virtual void setShowAnalog(bool s);
    virtual bool getShowAnalog();
    virtual void setShowDigital(bool s);
    virtual bool getShowDigital();
    virtual void setShowDigital_AMPM(bool s);
    virtual bool getShowDigital_AMPM();
//
    virtual void setFontDigital(IGUIFont* f);
    virtual IGUIFont* getFontDigital();

    virtual void setFontDigital_AMPM(IGUIFont* f);
    virtual IGUIFont* getFontDigital_AMPM();
    virtual void setPositionDigit_AMPM(core::position2di p);
    virtual core::position2di getPositionDigit_AMPM();
    virtual void setColorDigit_AMPM(video::SColor c);
    virtual video::SColor getColorDigit_AMPM();

    virtual void setDigitalBlinkSeconds(bool b);
    virtual bool getDigitalBlinkSeconds();
    virtual void movePositionDigitsTo(core::position2di p);
    virtual void setPositionDigits(core::position2di pH, core::position2di pM, core::position2di pS, core::position2di pA);
    virtual void setPositionDigit_H(core::position2di p);
    virtual core::position2di getPositionDigit_H();
    virtual void setPositionDigit_M(core::position2di p);
    virtual core::position2di getPositionDigit_M();
    virtual void setPositionDigit_S(core::position2di p);
    virtual core::position2di getPositionDigit_S();
    virtual void setColorDigits(video::SColor c);
    virtual void setColorDigits(video::SColor cH, video::SColor cM, video::SColor cS);
    virtual void setColorDigit_H(video::SColor c);
    virtual video::SColor getColorDigit_H();
    virtual void setColorDigit_M(video::SColor c);
    virtual video::SColor getColorDigit_M();
    virtual void setColorDigit_S(video::SColor c);
    virtual video::SColor getColorDigit_S();
    virtual void setRealTimeOffsetHours(s32 h);
    virtual s32 getRealTimeOffsetHours();
//
    virtual void serializeAttributes(io::IAttributes* out, io::SAttributeReadWriteOptions* options) const;
    virtual void deserializeAttributes(io::IAttributes* in, io::SAttributeReadWriteOptions* options);
Scene-Clock:

Code: Select all

    virtual void setNodes(ISceneNode* nB, ISceneNode* nH, ISceneNode* nM, ISceneNode* nS, bool removeCurrentFromScene=true);
    virtual void setNodeBody(ISceneNode* nB, bool removeCurrentFromScene=true);
    virtual void setNodeHour(ISceneNode* nH, bool removeCurrentFromScene=true);
    virtual void setNodeMinute(ISceneNode* nM, bool removeCurrentFromScene=true);
    virtual void setNodeSecond(ISceneNode* nS, bool removeCurrentFromScene=true);
    virtual void setNodes(IAnimatedMesh* mB, IAnimatedMesh* mH, IAnimatedMesh* mM, IAnimatedMesh* mS, bool removeCurrentFromScene=true);
    virtual void setNodeBody(IAnimatedMesh* mB, bool removeCurrentFromScene=true);
    virtual void setNodeHour(IAnimatedMesh* mH, bool removeCurrentFromScene=true);
    virtual void setNodeMinute(IAnimatedMesh* mM, bool removeCurrentFromScene=true);
    virtual void setNodeSecond(IAnimatedMesh* mS, bool removeCurrentFromScene=true);
    virtual ISceneNode* getNodeBody();
    virtual ISceneNode* getNodeHour();
    virtual ISceneNode* getNodeMinute();
    virtual ISceneNode* getNodeSecond();
//
    virtual void setRotationAxis(core::vector3df ra);
    virtual core::vector3df getRotationAxis();
    virtual void setTime(u32 h, u32 m, u32 s);
    virtual void setUseRealTime(bool useRT);
    virtual bool getUseRealTime();
    virtual void setIsPaused(bool p);
    virtual bool getIsPaused();
    virtual void setIs12hClock(bool use12h);
    virtual bool getIs12hClock();
    virtual void setRealTimeOffsetH(s32 h);
    virtual s32 getRealTimeOffsetH();
    virtual void setAutoUpdate(bool doAU);
    virtual bool getAutoUpdate();
    virtual void setSecondsForDay(f32 secs);
    virtual f32 getSecondsForDay();
    virtual void setMinutesForDay(f32 mins);
    virtual f32 getMinutesForDay();
    virtual void setHoursForDay(f32 hrs);
    virtual f32 getHoursForDay();
    virtual void setSecondsForHour(f32 secs);
    virtual f32 getSecondsForHour();
    virtual void setSecondsForMinute(f32 secs);
    virtual f32 getSecondsForMinute();
    virtual void setUpdatesPerSecond(f32 upd);
    virtual f32 getUpdatesPerSecond();
    virtual void setSyncClock(IClockSceneNode* clock);
    virtual void setSyncClock(gui::IGUIClock* clock);
    virtual IClockSceneNode* getSyncSceneClock();
    virtual gui::IGUIClock* getSyncGUIClock();
    virtual u32 getGameTimeHours();
    virtual u32 getGameTimeMinutes();
    virtual u32 getGameTimeSeconds();
    virtual f32 getGameTimeHoursFloat();
    virtual f32 getGameTimeMinutesFloat();
    virtual f32 getGameTimeSecondsFloat();
//
    virtual s32 getWeekDay(s32 y, u32 m, u32 d);
    virtual core::stringc getWeekDayName(s32 y, u32 m, u32 d);
    virtual core::stringw getWeekDayNameW(s32 y, u32 m, u32 d);
//
    virtual bool getGameTimeIsAM();
    virtual core::stringc getGameTimeString(bool showSeconds);
    virtual core::stringw getGameTimeStringW(bool showSeconds);
    virtual ESCENE_NODE_TYPE getType() const;
    virtual void setSmoothMovement(bool sm);
    virtual bool getSmoothMovement();
    virtual void setGameDate(s32 y, u32 m, u32 d);
    virtual void setGameDateYear(s32 y);
    virtual s32 getGameDateYear();
    virtual void setGameDateMonth(u32 m);
    virtual u32 getGameDateMonth();
    virtual core::stringc getGameDateMonthS();
    virtual core::stringw getGameDateMonthW();
    virtual void setGameDateMonthDay(u32 d);
    virtual u32 getGameDateMonthDay();
    virtual u32 getGameDateWeekDay();
    virtual core::stringc getGameDateWeekDayS();
    virtual core::stringw getGameDateWeekDayW();
    virtual core::stringc getGameDateString();
    virtual core::stringw getGameDateStringW();
//
    virtual void serializeAttributes(io::IAttributes* out, io::SAttributeReadWriteOptions* options=0) const;
    virtual void deserializeAttributes(io::IAttributes* in, io::SAttributeReadWriteOptions* options=0);
while(!asleep) sheep++;
IrrExtensions:Image
http://abusoft.g0dsoft.com
try Stendhal a MORPG written in Java
cobra
Posts: 371
Joined: Fri Jan 23, 2009 2:56 am
Location: United States
Contact:

Post by cobra »

Wow Acki!

Very nice clock, you put a lot of work into this.

I'll be sure to use it in my projects. ;)

I ran the demo, it's very cool.

What license is it under?
Josiah Hartzell
Image
Acki
Posts: 3496
Joined: Tue Jun 29, 2004 12:04 am
Location: Nobody's Place (Venlo NL)
Contact:

Post by Acki »

cobra wrote:Wow Acki!

Very nice clock, you put a lot of work into this.

I'll be sure to use it in my projects. ;)

I ran the demo, it's very cool.
thanks, but wait for the final version, it'll blow your mind !!! :lol:
it's already finished, but it depends on an other Extension, so it would be senseless to release it as a solo project...
cobra wrote:What license is it under?
like all my Extensions it's totally free !!! ;)
info.txt wrote:Use any code you want, it's free for any use (comercial or noncomercial) !!!
All graphic arts are made by me and also free for use !!!
But there is absolutely no warranty, use it on your own risk !!! ;)

Credits are always welcome !!! :)
while(!asleep) sheep++;
IrrExtensions:Image
http://abusoft.g0dsoft.com
try Stendhal a MORPG written in Java
Midnight
Posts: 1772
Joined: Fri Jul 02, 2004 2:37 pm
Location: Wonderland

Post by Midnight »

It's still a spinoff acki because I inspired you to post it. There was not a single clock on these forums until I posted a thread about it. And now there are 2 others besides my own.
cobra wrote:What license is it under?
Now ask him what his definition of free is.
Acki
Posts: 3496
Joined: Tue Jun 29, 2004 12:04 am
Location: Nobody's Place (Venlo NL)
Contact:

Post by Acki »

Midnight wrote:It's still a spinoff acki because I inspired you to post it. There was not a single clock on these forums until I posted a thread about it. And now there are 2 others besides my own.
thus you want to get your back scratched ??? :roll:
well then, yes the two threads forced me to post mine, too...
Midnight wrote:Now ask him what his definition of free is.
what's so hard to understand about "free for any use (comercial or noncomercial)" ???

sorry to say this, but in my eyes you're nothing more than a poor and untalented looser and uber-noob...
(awaiting more dirty words from you now, as it seems to be the only way for you to articulate :P )
while(!asleep) sheep++;
IrrExtensions:Image
http://abusoft.g0dsoft.com
try Stendhal a MORPG written in Java
Midnight
Posts: 1772
Joined: Fri Jul 02, 2004 2:37 pm
Location: Wonderland

Post by Midnight »

Acki wrote:
sorry to say this, but in my eyes you're nothing more than a poor and untalented looser and uber-noob...
(awaiting more dirty words from you now, as it seems to be the only way for you to articulate :P )
If you think that's the only way I can articulate then you haven't been paying attention. And ignored.

It's funny you should say that I'm an untalented "looser" and uber-noob. Because those are exactly the words that describe you.

This was entirely unprovoked and you are acting like a "looser".

You have released other sources that had those incorrectly named free licenses and this time you were intentionally vague aswell. I only mentioned it because I thought perhaps you might have a legitimately different opinion on the term. I didn't come here to troll you or whatever other phobias you obviously have for me.

And dare I stoop so low as to say that's about the time you started bleeding between the legs. (oh come on that's just f-u-cking funny like is usually intended every time I talk but you're unwilling to get the joke.)

Suck it. We finally got rid of jay leno!
Acki
Posts: 3496
Joined: Tue Jun 29, 2004 12:04 am
Location: Nobody's Place (Venlo NL)
Contact:

Post by Acki »

Midnight wrote:It's funny you should say that I'm an untalented "looser" and uber-noob. Because those are exactly the words that describe you.

This was entirely unprovoked and you are acting like a "looser".
no own ideas anymore ??? :lol:
Midnight wrote:You have released other sources that had those incorrectly named free licenses and this time you were intentionally vague aswell. I only mentioned it because I thought perhaps you might have a legitimately different opinion on the term.
why should I search for a license that has 100s of words and only lawyers realy can understand when I can say it with a few words... :roll:
if you don't trust it, don't use it, that simple it is... ;)
Midnight wrote:I didn't come here to troll you or whatever other phobias you obviously have for me.
I just don't like your attitude and the way you're acting and treading other people...
it seems you learnd some heavy words in the kinder garden and now you're trying to to use them to to prove you're a big tuff guy... :roll:
Midnight wrote:And dare I stoop so low as to say that's about the time you started bleeding between the legs. (oh come on that's just f-u-cking funny like is usually intended every time I talk but you're unwilling to get the joke.)
in fact I got it, also others may be offended by such...
and I'm sure more than 90% of you "jokes" aren't meant as jokes...
what I realy dislike about such behavior is that there are many kids in the forum you should think about...
not to say that this behavior is against general forum rules/netiquette !!!

because I'm tired to talk to whimps and this has absolutely nothing to do with this thread, I'll stop here and declare this conversation with you as ended !!!
come with something topic related or simply shut up... :P
while(!asleep) sheep++;
IrrExtensions:Image
http://abusoft.g0dsoft.com
try Stendhal a MORPG written in Java
sio2
Competition winner
Posts: 1003
Joined: Thu Sep 21, 2006 5:33 pm
Location: UK

Post by sio2 »

Acki wrote:

Code: Select all

    virtual void setBodyTexture(video::ITexture* texture);
<...SNIP...>
I'm curious - why is every function virtual?
Acki
Posts: 3496
Joined: Tue Jun 29, 2004 12:04 am
Location: Nobody's Place (Venlo NL)
Contact:

Post by Acki »

sio2 wrote:
Acki wrote:

Code: Select all

    virtual void setBodyTexture(video::ITexture* texture);
<...SNIP...>
I'm curious - why is every function virtual?
because it's the way Irrlicht was created and all functions are declared so in Irrlicht (well, at least most of them)...
open any header file from an Irrlicht class and you'll see... ;)
while(!asleep) sheep++;
IrrExtensions:Image
http://abusoft.g0dsoft.com
try Stendhal a MORPG written in Java
Post Reply