自拍偷在线精品自拍偷,亚洲欧美中文日韩v在线观看不卡

S40 Touch API - Text Editor API

移動開發(fā)
TextEditor是一個可編輯的文本組件,它直接繪制在Canvas或CustomItem上。

TextEditor是一個可編輯的文本組件,它直接繪制在Canvas或CustomItem上。

有過游戲編程經(jīng)驗的工程師一定碰到過需要在游戲中輸入中文的情況。遇到這種情況,不是索性用輸入英文或拼音字母代替,就是將界面切換到使用控件的窗口,待輸入完中文后,再返回游戲頁面。TextEditor的實現(xiàn),徹底解決了這個問題。

TextEditor的主要方法包括:

boolean register( x, y, maxFps, maxPps, FrameAnimatorListenerlistener)	
void unregister()
boolean isRegistered()
static int getNumRegisteredFrameAnimators();
void drag(x, y)
void kineticScroll( int startSpeed, int direction, int friction, float angle )
void stop()

在創(chuàng)建TextEditor的實例的時候,不是使用常用的new()方法,而是通過TextEditor 的兩個重載的工廠方法實現(xiàn)的。這兩個方法的參數(shù)略有不同,可根據(jù)實際情況選擇使用。

// Creates a new empty TextEditor with the given maximum size in characters, constraints and editor size as number of visible rows.
static TextEditor createTextEditor(int maxSize, int constraints, int width, int rows)

// Creates a new TextEditor object with the given initial contents, maximum size in characters, constraints and editor size in pixels.
static TextEditor createTextEditor(java.lang.String text, int maxSize, int constraints, int width, int height)

下面的代碼演示了如何使用TextEditor:

TextEditor editor=TextEditor.createTextEditor("abc", 20, TextField.ANY, getWidth()-20, 100);		
editor.setMultiline(true);
editor.setVisible(true);
editor.setFocus(true);
editor.setPosition(10, 10);
editor.setParent(this); // this point to a Canvas

 

責(zé)任編輯:Yeva 來源: NOKIA Developer
相關(guān)推薦

2013-01-25 14:48:57

Series 40S40

2013-01-25 14:44:47

S40Series 40

2013-01-25 15:04:30

S40Series 40

2013-01-25 14:08:32

S40Series 40

2013-01-25 13:49:26

S40Series 40

2013-01-25 14:06:17

S40Series 40

2013-01-25 15:29:14

s40Series 40

2012-03-26 21:45:13

S40

2013-10-31 14:30:44

CloudaAPI

2011-09-02 16:08:09

Sencha ToucAPI文檔

2012-02-02 09:06:44

SymbianS40諾基亞

2018-04-25 09:33:54

Windows 10Vim Text Ed

2024-06-26 00:22:35

2012-12-14 14:48:01

諾基亞Series 40S40

2021-08-09 08:20:59

API安全測試漏洞

2014-12-22 10:28:47

2023-06-26 18:13:56

開源API

2012-04-13 09:17:19

微軟API必應(yīng)搜索

2017-03-15 16:05:19

ChromeAPI瀏覽器
點贊
收藏

51CTO技術(shù)棧公眾號