本文整理汇总了C++中AnimatedSprite::SetSubRectSize方法的典型用法代码示例。如果您正苦于以下问题:C++ AnimatedSprite::SetSubRectSize方法的具体用法?C++ AnimatedSprite::SetSubRectSize怎么用?C++ AnimatedSprite::SetSubRectSize使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类AnimatedSprite
的用法示例。
在下文中一共展示了AnimatedSprite::SetSubRectSize方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: InitializeAsClient
void Root::InitializeAsClient(const sf::VideoMode& video_mode,
const std::string& window_title,
const bool is_fullscreen,
const sf::IpAddress& server_ip,
const sf::Uint16 server_port,
const std::string name,
bool is_verbose) {
mIsServer = false;
if(is_verbose)
mLogger.SetShowLevels(0x00011111);
else
mLogger.SetShowLevels(0x00011100);
Logger::Urgent(LogOrigin::ROOT, "Initializing Root as client.");
// Request a 24 bits depth buffer
// Request a 8 bits stencil buffer
// Request 8 levels of antialiasing
sf::ContextSettings Settings(24, 8, 8);
mRenderWindow = boost::shared_ptr<sf::RenderWindow>(new sf::RenderWindow());
// Create Render Window
if(is_fullscreen)
mRenderWindow->Create(video_mode, window_title, sf::Style::Fullscreen, Settings);
else
mRenderWindow->Create(video_mode, window_title, sf::Style::Close | sf::Style::Resize, Settings);
// Create & initialize world view
ResetView();
// Load Engine Resources (Default GUI etc.)
mResourceManager.AddImage(boost::filesystem::path("../engine/gui"),"default_gui.svg", 512.f/mWorldPixelsPerFloat, 512.f/mWorldPixelsPerFloat, "default_gui");
GuiTexture default_gui_texture;
default_gui_texture.LoadLayoutFile("../engine/gui/default_layout.info");
mResourceManager.AddGuiTexture(default_gui_texture);
int cursor_size = 24;
mResourceManager.AddImage(boost::filesystem::path("../engine/gui"),"cursors.svg", cursor_size*16.f/mWorldPixelsPerFloat, cursor_size*16.f/mWorldPixelsPerFloat, "gui.default.cursors");
AnimatedSprite arrow;
arrow.SetImage(mResourceManager.GetImage("gui.default.cursors"));
arrow.SetSubRectSize(sf::Vector2f(cursor_size,cursor_size));
arrow.SetSubRectOffset(sf::Vector2f(0,0));
arrow.SetFPS(0);
arrow.SetNumFrames(1);
mResourceManager.SetCursorSprite(arrow, MOUSECURSOR_ARROW);
AnimatedSprite busy;
busy.SetImage(mResourceManager.GetImage("gui.default.cursors"));
busy.SetSubRectSize(sf::Vector2f(cursor_size,cursor_size));
busy.SetSubRectOffset(sf::Vector2f(0,cursor_size));
busy.SetFPS(8);
busy.SetNumFrames(8);
mResourceManager.SetCursorSprite(busy, MOUSECURSOR_BUSY);
mResourceManager.SetCursor(MOUSECURSOR_ARROW);
//mInputManager = InputManager();
//mStateManager = StateManager();
//mResourceManager = ResourceManager();
// Create and Initialize Network Manager
// mNetworkManager = NetworkManager();
mClientName = name;
mNetworkManager.InitializeAsClient(server_ip, server_port, name);
mTakeScreenshot = false;
}