Difference between revisions of "love.textinput (한국어)"

(Created page with "{{newin|0.9.0|090|type=function}} 사용자가 텍스트를 입력했을 때 호출됩니다. 예를 들어 사용자가 시프트 2를 눌렀을 때 텍스트 "@"이 만들...")
 
Line 35: Line 35:
 
* [[love.keyboard.hasTextInput (한국어)]]
 
* [[love.keyboard.hasTextInput (한국어)]]
 
[[Category:Callbacks]]
 
[[Category:Callbacks]]
{{#set:Description=Called when text has been entered by the user.}}
+
{{#set:Description=사용자가 텍스트를 입력했을 때 호출됩니다.}}
 
{{#set:Subcategory=General}}
 
{{#set:Subcategory=General}}
 
== Other Languages ==
 
== Other Languages ==
 
{{i18n|love.textinput}}
 
{{i18n|love.textinput}}

Revision as of 02:29, 27 December 2013

Available since LÖVE 0.9.0
This function is not supported in earlier versions.

사용자가 텍스트를 입력했을 때 호출됩니다. 예를 들어 사용자가 시프트 2를 눌렀을 때 텍스트 "@"이 만들어집니다.

함수

형식

love.textinput( text )

매개변수

string (한국어) text
UTF-8로 인코딩된 텍스트.

리턴값

없음.

Notes

Although Lua strings can store UTF-8 encoded unicode text just fine, many functions in Lua's string library will not treat the text as you might expect. For example, #text (and string.len(text)) will give the number of bytes in the string, rather than the number of unicode characters. The Lua wiki and a presentation by one of Lua's creators give more in-depth explanations, with some tips.

Examples

Record and print text the user writes.

function love.load()
    text = "Type away! -- "
end

function love.textinput(t)
    text = text .. t
end

function love.draw()
    love.graphics.printf(text, 0, 0, love.graphics.getWidth())
end

같이 보기


Other Languages