00001 // SuperTux 00002 // Copyright (C) 2006 Matthias Braun <matze@braunis.de> 00003 // 00004 // This program is free software: you can redistribute it and/or modify 00005 // it under the terms of the GNU General Public License as published by 00006 // the Free Software Foundation, either version 3 of the License, or 00007 // (at your option) any later version. 00008 // 00009 // This program is distributed in the hope that it will be useful, 00010 // but WITHOUT ANY WARRANTY; without even the implied warranty of 00011 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00012 // GNU General Public License for more details. 00013 // 00014 // You should have received a copy of the GNU General Public License 00015 // along with this program. If not, see <http://www.gnu.org/licenses/>. 00016 00017 #ifndef HEADER_SUPERTUX_OBJECT_DISPLAY_EFFECT_HPP 00018 #define HEADER_SUPERTUX_OBJECT_DISPLAY_EFFECT_HPP 00019 00020 #include "scripting/display_effect.hpp" 00021 #include "supertux/game_object.hpp" 00022 #include "supertux/script_interface.hpp" 00023 00024 class DisplayEffect : public GameObject, 00025 public scripting::DisplayEffect, 00026 public ScriptInterface 00027 { 00028 public: 00029 DisplayEffect(std::string name = ""); 00030 virtual ~DisplayEffect(); 00031 00032 void expose(HSQUIRRELVM vm, SQInteger table_idx); 00033 void unexpose(HSQUIRRELVM vm, SQInteger table_idx); 00034 00035 void update(float elapsed_time); 00036 void draw(DrawingContext& context); 00037 00043 void fade_out(float fadetime); 00044 void fade_in(float fadetime); 00045 void set_black(bool enabled); 00046 bool is_black(); 00047 void sixteen_to_nine(float fadetime); 00048 void four_to_three(float fadetime); 00049 00054 private: 00055 enum FadeType { 00056 NO_FADE, FADE_IN, FADE_OUT 00057 }; 00058 FadeType screen_fade; 00059 float screen_fadetime; 00060 float screen_fading; 00061 FadeType border_fade; 00062 float border_fadetime; 00063 float border_fading; 00064 float border_size; 00065 00066 bool black; 00067 bool borders; 00068 }; 00069 00070 #endif 00071 00072 /* EOF */