00001 /* 00002 CS Senior Project 2003 00003 Team : Leftfield 00004 Project : ModernWarfare 00005 Members : 00006 - Russ Christensen <rchriste@cs.utah.edu> 00007 - Todd Smith <tcsmith@cs.utah.edu> 00008 - Usit Duongsaa <duongsaa@cs.utah.edu> 00009 Copyright 2003 Russ Christensen, Usit Duongsaa, and Todd Smith. All rights reserved. 00010 00011 Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 00012 00013 Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 00014 Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 00015 THIS SOFTWARE IS PROVIDED BY RUSS CHRISTENSEN, USIT DUONGSAA, AND TODD SMITH ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL RUSS, USIT, TODD OR OTHER CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 00016 */ 00017 00022 #ifndef INCLUDE_ICON 00023 #define INCLUDE_ICON 00024 00025 #include "..\AEngine\AEngine.h" 00026 #include "Rect.h" 00027 00028 class Icon: public Rect 00029 { 00030 public: 00031 Icon(); 00032 Icon(Vec2D& ul, Vec2D& lr, ATexture img); 00033 00034 const ATexture image() const; 00035 void setImage(ATexture img); 00036 void setBounds(const Vec2D& ul, const Vec2D& lr); 00037 void setHelpString( string s ); 00038 void render() const; 00039 void drawOutline( Vec3D color ) const; 00040 void drawHelpString() const; // if cursor is over this icon and mouse is idle, draw help box 00041 00042 private: 00043 ATexture m_img; 00044 Vec2D m_center; 00045 Vec2D m_size; 00046 string m_helpString; // if you hover your mouse over it, this string will be drawn 00047 }; 00048 00049 inline const ATexture Icon::image() const { return m_img; } 00050 inline void Icon::setImage(ATexture img) { m_img = img; } 00051 inline void Icon::setHelpString( string s ) { m_helpString = s; } 00052 inline void Icon::render() const { if(m_img) overlay_image(m_img, m_center, m_size, BlendModes::NONE, 1.0f, 6); } 00053 00054 #endif
1.3-rc2