2011년 3월 2일 수요일

Corona SDK......01 - Hello World

Corona SDK 는 기본적으로 두개의 파일이 필요 한듯..

config.lua -> 화명 해상도 등 설정 파일인듯...
main.lua -> 이건 이름이 달라도 상관 없는듯...

config.lua 내용

-- config.lua

application =
{
content =
{
width = 320,  -- 가로 해상도
height = 480,  -- 세로 해상도
scale = "zoomEven" -- zoom to fill screen, possibly cropping edges
},
}

Scale 는

  • "none" - turns off dynamic content scaling
    : Content 와 Sacle 를 무시(?)
  • "letterbox" - uniformly scales up content as much as possible, while still showing all content on the screen. This is similar to watching a widescreen DVD on a non-widescreen TV set, except that you can use offstage content to fill the "bleed" areas rather than displaying black bars.
    : 대충 봐서는...Content 를 가능한 최대로 표시 한다는 옵션.
    : 마치 DVD 영화를 TV 에서 보면 아래 위가 검은색으로 채워 지는것 같음.
       
  • "zoomEven" - uniformly scales up content to fill the screen, while preserving aspect ratio. Some content may appear offscreen, if the new screen has a different aspect ratio
    : 가로 세로 비율을 유지하면서 스크린에 내용 채우기.
  • "zoomStretch" - non-uniformly scales up content to fill the screen. All content will remain onscreen, but it may be stretched vertically or horizontally.
    : 비율을 유지 하지 않고 스크린에 맞게 내용 채우기.
    : 가로 / 세로 한쪽을 길어져서 보일 수 있음. 

실제 게임을 만들기 위해서는 별다른 차이가 없어 보임. ( 현재까지는.. )

main.lua


local textObject = display.newText( "Hello World!", 50, 50, native.systemFont, 124 )
-- 화면에 Text 박스(?) 를 생성함.
-- display.newText Text 박스를 생성하는 Function 정도(?)
textObject:setTextColor( 255,255,255 )
-- Text 박스의 색 지정.

** display : displayObject 를 생성 할때 사용 하는놈..
Image 를 만들고 싶어면...
local image = display.newImage("xxx.png")

이렇게 해서 생성 할 수 있음. 

댓글 없음:

댓글 쓰기