游戏开发论坛

 找回密码
 立即注册
搜索
查看: 9891|回复: 26

关于游戏中文本的输入解决

[复制链接]

187

主题

6490

帖子

6491

积分

论坛元老

团长

Rank: 8Rank: 8

积分
6491
发表于 2006-11-5 13:13:00 | 显示全部楼层 |阅读模式
大家有什么好的方案??
如果用TextBox太难看了。用其他的直接接收的方式又不好输入中文。

248

主题

2674

帖子

2702

积分

金牌会员

Rank: 6Rank: 6

积分
2702
QQ
发表于 2006-11-5 13:27:00 | 显示全部楼层

Re:关于游戏中文本的输入解决

如果是.net, 应该可以修改textBox的外观。

45

主题

222

帖子

229

积分

中级会员

Rank: 3Rank: 3

积分
229
发表于 2006-11-5 15:45:00 | 显示全部楼层

Re:关于游戏中文本的输入解决

楼上的是一种不错解决方法,可以试一下。
还有就是用win32 api或dx input来检测键盘按键。类似于做一个文本控件。
星际里的文本框如何,游戏目录里有个Riched20.dll文件,要是能研究出他的用法,借用一下也不错。

270

主题

6442

帖子

6446

积分

论坛元老

Rank: 8Rank: 8

积分
6446
发表于 2006-11-5 16:49:00 | 显示全部楼层

Re:关于游戏中文本的输入解决

直接取字库啦!!

89

主题

4036

帖子

4132

积分

论坛元老

Rank: 8Rank: 8

积分
4132
发表于 2006-11-5 17:17:00 | 显示全部楼层

Re:关于游戏中文本的输入解决

msdn 里查 IME

5

主题

972

帖子

975

积分

高级会员

Rank: 4

积分
975
发表于 2006-11-5 18:17:00 | 显示全部楼层

Re:关于游戏中文本的输入解决

自己做个中文输入法

187

主题

6490

帖子

6491

积分

论坛元老

团长

Rank: 8Rank: 8

积分
6491
 楼主| 发表于 2006-11-5 18:23:00 | 显示全部楼层

Re: Re:关于游戏中文本的输入解决

xiaoid: Re:关于游戏中文本的输入解决

楼上的是一种不错解决方法,可以试一下。
还有就是用win32 api或dx input来检测键盘按键。类似于做一个文本...

星际里的文本框也不能输入中文啊。

187

主题

6490

帖子

6491

积分

论坛元老

团长

Rank: 8Rank: 8

积分
6491
 楼主| 发表于 2006-11-5 18:34:00 | 显示全部楼层

Re:关于游戏中文本的输入解决

藏在后面还怎么接受输入的消息??

187

主题

6490

帖子

6491

积分

论坛元老

团长

Rank: 8Rank: 8

积分
6491
 楼主| 发表于 2006-11-5 18:40:00 | 显示全部楼层

Re:关于游戏中文本的输入解决

哦,好,谢谢,我试试看。
(怎么那么别扭???)

187

主题

6490

帖子

6491

积分

论坛元老

团长

Rank: 8Rank: 8

积分
6491
 楼主| 发表于 2006-11-5 18:58:00 | 显示全部楼层

Re:关于游戏中文本的输入解决

WM_IME_CHAR
Sent to an application when the IME gets a character of the conversion result. A window receives this message through its WindowProc function.

LRESULT CALLBACK WindowProc(
HWND hwnd,
WM_IME_CHAR,
WPARAM wParam,
LPARAM lParam   
);
Parameters
wParam
DBCS: A single- or double-byte character value. For a double-byte character, (BYTE)(wParam >> 8) contains the lead byte. Note that the parentheses are necessary because the cast operator has higher precedence than the shift operator.
Unicode: A Unicode character value.

lParam
The repeat count, scan code, extended key flag, context code, previous key state flag, and transition state flag, with values as defined below. Bit Meaning
0-15 Repeat count. Since the first byte and second byte is continuous, this is always 1.
16-23 Scan code for a complete Asian character.
24 Extended key.
25-28 Not used.
29 Context code.
30 Previous key state.
31 Transition state.


Remarks
Unlike the WM_CHAR message for a non-Unicode window, this message can include double-byte as well as single-byte character values. For a Unicode window, this message is the same as WM_CHAR.
For a non-Unicode window, if the WM_IME_CHAR message includes a double-byte character and the application passes this message to DefWindowProc, the IME converts this message into two WM_CHAR messages, each containing one byte of the double-byte character.

Requirements
  Windows NT/2000/XP/Vista: Included in Windows NT 4.0 and later.
  Windows 95/98/Me: Included in Windows 95 and later.
  Header: Declared in Imm.h; include Windows.h.

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

作品发布|文章投稿|广告合作|关于本站|游戏开发论坛 ( 闽ICP备17032699号-3 )

GMT+8, 2025-12-20 04:40

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表