Changeset 3781 in orxonox.OLD for orxonox/branches/textEngine
- Timestamp:
- Apr 12, 2005, 1:05:46 AM (20 years ago)
- Location:
- orxonox/branches/textEngine/src
- Files:
-
- 4 edited
- 1 copied
Legend:
- Unmodified
- Added
- Removed
-
orxonox/branches/textEngine/src/Makefile.am
r3778 r3781 80 80 track_manager.h \ 81 81 track_node.h \ 82 animation.h \ 82 83 simple_animation.h \ 83 84 garbage_collector.h \ -
orxonox/branches/textEngine/src/Makefile.in
r3778 r3781 288 288 track_manager.h \ 289 289 track_node.h \ 290 animation.h \ 290 291 simple_animation.h \ 291 292 garbage_collector.h \ -
orxonox/branches/textEngine/src/animation.h
r3779 r3781 1 /*! 2 \file proto_class.h 3 \brief Definition of the proto class template, used quickly start work 4 \todo Example: this shows how to use simply add a Marker that here has to be done something. 1 /* 2 orxonox - the future of 3D-vertical-scrollers 5 3 6 The Protoclass exists, to help you quikly getting the run for how to develop in orxonox. 7 It is an example for the CODING-CONVENTION, and a starting-point for every class. 4 Copyright (C) 2004 orx 5 6 This program is free software; you can redistribute it and/or modify 7 it under the terms of the GNU General Public License as published by 8 the Free Software Foundation; either version 2, or (at your option) 9 any later version. 10 11 ### File Specific: 12 main-programmer: Benjamin Grauer 13 co-programmer: ... 8 14 */ 9 15 10 #ifndef _PROTO_CLASS_H11 #define _PROTO_CLASS_H12 16 13 #include "what realy has to be included" 17 /*! 18 \file animation.h 19 A Set of functions to animate some floats inside of an Object 20 */ 21 22 #ifndef _ANIMATION_H 23 #define _ANIMATION_H 24 14 25 #include "base_object.h" 15 26 16 // FORWARD DEFINITION \\ 17 class someClassWeNeed; 27 enum ANIM_FUNCTION {ANIM_LINEAR }; 28 29 //! A Class to handle some animation for single floated values. 30 template<class T> class Animation : public BaseObject 31 { 32 public: 33 Animation(); 34 virtual ~Animation(); 35 36 void setFuncToAnim(T* object, void (T::*animFunc)(float)); 37 void setAnimFunc(); 38 void setValue(float value); 39 40 void tick(float time); 41 42 private: 43 void (T::*animFunc)(float); 44 45 float value; 46 T* object; 47 }; 18 48 19 49 20 /*class Test;*/ /* forward definition of class Test (without including it here!)*/21 50 22 //! A default class that aids you to start creating a new class23 51 /** 24 here can be some longer description of this class 52 \brief standard constructor 53 25 54 */ 26 class ProtoClass : public BaseObject { 55 template<class T> 56 Animation<T>::Animation () 57 { 58 this->setClassName ("Animation"); 59 this->value = 0.0; 60 } 27 61 28 public:29 ProtoClass();30 virtual ~ProtoClass();31 62 32 bool doNonSense (int nothing); 63 /** 64 \brief standard deconstructor 33 65 34 private: 35 int nonSense; //!< doxygen tag here like this for all the variables - delete this variable if you use this 66 */ 67 template<class T> 68 Animation<T>::~Animation () 69 { 70 // delete what has to be deleted here 71 } 36 72 37 };38 73 39 #endif /* _PROTO_CLASS_H */ 74 template<class T> 75 void Animation<T>::setFuncToAnim(T* object, void (T::*animFunc)(float)) 76 { 77 this->object = object; 78 this->animFunc = animFunc; 79 } 80 81 template<class T> 82 void Animation<T>::setValue(float value) 83 { 84 this->value = value; 85 (object->*(animFunc))(value); 86 } 87 88 template<class T> 89 void Animation<T>::tick(float time) 90 { 91 setValue(value+time/1000); 92 if (value >1) 93 setValue (0); 94 } 95 96 #endif /* _ANIMATION_H */ -
orxonox/branches/textEngine/src/story_entities/world.cc
r3777 r3781 40 40 #include "glmenu_imagescreen.h" 41 41 #include "list.h" 42 43 #include "animation.h" 42 44 43 45 using namespace std; … … 354 356 this->testText = TextEngine::getInstance()->createText("fonts/earth.ttf", 30, TEXT_DYNAMIC, 0, 255, 0); 355 357 testText->setText("TEXT rocks"); 356 testText->setBlending( .5);358 testText->setBlending(1.0); 357 359 testText->setBindNode(tn); 358 360 361 362 tmpAnim = new Animation<Text>(); 363 364 tmpAnim->setFuncToAnim(testText, &Text::setBlending); 359 365 break; 360 366 } … … 780 786 this->localCamera->tick(this->dt); 781 787 this->garbageCollector->tick(seconds); 788 tmpAnim->tick(this->dt); 782 789 } 783 790 this->lastFrame = currentFrame; -
orxonox/branches/textEngine/src/story_entities/world.h
r3769 r3781 24 24 class GarbageCollector; 25 25 class Text; 26 template<class T> class Animation; 26 27 27 28 //! The game world Interface … … 95 96 bool bPause; //!< pause mode 96 97 98 Animation<Text>* tmpAnim; 97 99 Text* testText; //!< A text to Test the TextEngine; 98 100 GLMenuImageScreen* glmis; //!< The Level-Loader Display
Note: See TracChangeset
for help on using the changeset viewer.