English 中文(简体)
• 如何在C++/directx建立一个菜单系统?
原标题:How do you set up a menuing system (clickable buttons) in C++/directx?

我因此认为,需要职能点来分配职能,以掌握将作为ton子的图像,但我无法找到这方面的任何体面资源。

你们如何在C++中建立纽纽子? 例如,有用于储蓄、装货、出货的垫子。

<<>strong>edit: 在这方面,我并不担心能否运输。 我不是利用预先界定的框架。 该系统只使用Windows机器。

问题回答

你们需要写写出一套使用全球倡议界面(布顿语、文字)和一些基本“镜像探测”的地球静止倡议课程,以发现用户在潮.中点击该分子。

你不一定要使用职能点,而是更方便。 以下例子同样能够做到。

相反,我要写一个有位置、宽度、高等的县级,这样,如果 mo点被点击,你就可以写出一种返回的方法,而不需要你可以避免的任何硬编码。

如果你想要实施一个非常基本、非灵活的全球倡议,你就可以发现烟火点:

if ( mouseWasClicked == true )
{
    if (( mouseX > startButton.minX && mouseX < startButton.maxX ) && 
        ( mouseY > startButton.minY && startButton.maxY < mouseY) )
    {
        loadGame();
    }
}

尽管如此,我还是建议使用一个适当的图书馆,以建立一个全球倡议系统,例如CEGUI,这个系统是开放源,与Ogre等招标引擎合作。 CEGUI也比Qt更为便携和轻重。 如果你正在策划一场游戏,建议这样做。

除非你重新学习低级工作的方式,使用经证明的物品,否则将重新发明轮轮椅。

你基本上必须做你们自己的所有绘画、停用跟踪等。 直接XSDK本身有样本显示整个窗口框架,并有控制。

然而,可以通过使用CEGUI,来大大简化。 Crazy Eddie s GUI提供了整个框架,准备去做和光辉,以在直接X进行显示和控制,包括纽州、菜单等。

这不是你的答复所暗示的一种语言特征——你现在处于全球倡议的范畴和框架之中,而这种框架常常是不可自由的。

因此,我建议Qt。 跨平台、成熟、有充分记录和成熟。 还有其他一些选择,还有许多指导你的工作费用。





相关问题
Undefined reference

I m getting this linker error. I know a way around it, but it s bugging me because another part of the project s linking fine and it s designed almost identically. First, I have namespace LCD. Then I ...

C++ Equivalent of Tidy

Is there an equivalent to tidy for HTML code for C++? I have searched on the internet, but I find nothing but C++ wrappers for tidy, etc... I think the keyword tidy is what has me hung up. I am ...

Template Classes in C++ ... a required skill set?

I m new to C++ and am wondering how much time I should invest in learning how to implement template classes. Are they widely used in industry, or is this something I should move through quickly?

Print possible strings created from a Number

Given a 10 digit Telephone Number, we have to print all possible strings created from that. The mapping of the numbers is the one as exactly on a phone s keypad. i.e. for 1,0-> No Letter for 2->...

typedef ing STL wstring

Why is it when i do the following i get errors when relating to with wchar_t? namespace Foo { typedef std::wstring String; } Now i declare all my strings as Foo::String through out the program, ...

C# Marshal / Pinvoke CBitmap?

I cannot figure out how to marshal a C++ CBitmap to a C# Bitmap or Image class. My import looks like this: [DllImport(@"test.dll", CharSet = CharSet.Unicode)] public static extern IntPtr ...

Window iconification status via Xlib

Is it possible to check with the means of pure X11/Xlib only whether the given window is iconified/minimized, and, if it is, how?

热门标签