[블로그] 블로그에 코딩 색 입히는 방법.

|

가장 쉬운 방벙은

visual studio 에서 작업한 내용을  ms word에 붙이고 그걸 다시 복사해서 블로그에 붙이면 소스 코드 색을 그대로 입힐수 있음


다른 방법은 사이트를 통한 방법

http://markup.su/highlighter/


여기에서 코드를 입력하고 highlight버튼을 클릭하면 변형이 됨.


Trackback 0 And Comment 0

유니티 Vector3 를 상수 선언 하고 싶을때.

|


유니티 상에서 상수를 취급할때는 앞에 const 키워드를 붙여서 처리할수있습니다.

하지만 Vector3 값이나 다른 값들을 상수 취급하고 싶을때가 있습니다.

그럴때는 c# 의 프로퍼티 기능을 사용해서 상수로 취급할 수 있습니다.(읽어올수만 있게 만들기)



//선언부

public Vector3 MAXSIZE { get { return new Vector3(0.9f0.9f0.9f); } }



//사용시

Vector3 size = transform.localScale;

           

            if(size.x < MAXSIZE.x)

              size.x += 0.05f;

            if (size.y < MAXSIZE.y)           

              size.y += 0.05f;

            if (size.z < MAXSIZE.z)           

              size.z += 0.05f;


//값 대입시 에러 발생

MAXSIZE.x = 10; 



이렇게 파일을 적용하면 읽어오는 기능만 정의되어 값을 대입할수 없습니다.


Trackback 0 And Comment 0

[Transitions] Scene의 장면전환 효과

|

Transitions

소개

cocos2d-x의 멋진 특징중 하나인 두개의 씬 사이에 장면을 전환하는 효과입니다. 예를들어서(wipe, fade, zoom, and split등)
Transition Sceneclass은 CocosNode와 Layer로 부터 파생되어 나왔습니다.
일반적으로 transition scene은 새로운 scene로 넘어가기 전에 장면 전환 효과를 수행하게 됩니다.

Create transition

첫번째 인자의 시간은 트랜지션를위한 시간 (초)입니다. 다음과 같은 장면 전환을 적용하려면 구문은 다음과 같습니다

1CCDirector::sharedDirector()->replaceScene(CCTransitionFade::create(0.5,newScene));


일부 트랜지션은 사용자 지정 매개 변수 (들)을 가지고 있습니다. 예를 들어, FadeTransition 매개 변수로 페이드 색깔이있다.
static CCTransitionFade* create(float duration,CCScene* scene, const ccColor3B& color);

장면 전환을 하는 것은 매우 쉽습니다.

 1CCScene *s = SecondPage::scene();
 2
 3//CCTransitionProgressRadialCW,CCTransitionProgressRadialCCW,CCTransitionCrossFade需要以下设置
 4//CCConfiguration::sharedconfiguration()->getGlesVersion<=GLES_VER_1_0
 5
 6//启动摄像机测试景深,只有CCTransitionPageTurn才需要
 7CCDirector::sharedDirector()->setDepthTest(true);
 8
 9//false为下一页,true为上一页
10CCTransitionScene *transition = CCTransitionPageTurn::create(3.0f, s, false);

“page turn” 효과를 사용하면 이것은 책을 넘기는 효과 처럼 보인다.

트랜잭션의 종류



class  CCTransitionEaseScene
 CCTransitionEaseScene can ease the actions of the scene protocol. More...
 
class  CCTransitionScene
 Base class for CCTransition scenes. More...
 
class  CCTransitionSceneOriented
 A CCTransition that supports orientation like. More...
 
class  CCTransitionRotoZoom
 CCTransitionRotoZoom: Rotate and zoom out the outgoing scene, and then rotate and zoom in the incoming.More...
 
class  CCTransitionJumpZoom
 CCTransitionJumpZoom: Zoom out and jump the outgoing scene, and then jump and zoom in the incoming.More...
 
class  CCTransitionMoveInL
 CCTransitionMoveInL: Move in from to the left the incoming scene. More...
 
class  CCTransitionMoveInR
 CCTransitionMoveInR: Move in from to the right the incoming scene. More...
 
class  CCTransitionMoveInT
 CCTransitionMoveInT: Move in from to the top the incoming scene. More...
 
class  CCTransitionMoveInB
 CCTransitionMoveInB: Move in from to the bottom the incoming scene. More...
 
class  CCTransitionSlideInL
 CCTransitionSlideInL: Slide in the incoming scene from the left border. More...
 
class  CCTransitionSlideInR
 CCTransitionSlideInR: Slide in the incoming scene from the right border. More...
 
class  CCTransitionSlideInB
 CCTransitionSlideInB: Slide in the incoming scene from the bottom border. More...
 
class  CCTransitionSlideInT
 CCTransitionSlideInT: Slide in the incoming scene from the top border. More...
 
class  CCTransitionShrinkGrow
 Shrink the outgoing scene while grow the incoming scene. More...
 
class  CCTransitionFlipX
 CCTransitionFlipX: Flips the screen horizontally. More...
 
class  CCTransitionFlipY
 CCTransitionFlipY: Flips the screen vertically. More...
 
class  CCTransitionFlipAngular
 CCTransitionFlipAngular: Flips the screen half horizontally and half vertically. More...
 
class  CCTransitionZoomFlipX
 CCTransitionZoomFlipX: Flips the screen horizontally doing a zoom out/in The front face is the outgoing scene and the back face is the incoming scene. More...
 
class  CCTransitionZoomFlipY
 CCTransitionZoomFlipY: Flips the screen vertically doing a little zooming out/in The front face is the outgoing scene and the back face is the incoming scene. More...
 
class  CCTransitionZoomFlipAngular
 CCTransitionZoomFlipAngular: Flips the screen half horizontally and half vertically doing a little zooming out/in. More...
 
class  CCTransitionFade
 CCTransitionFade: Fade out the outgoing scene and then fade in the incoming scene. More...
 
class  CCTransitionCrossFade
 CCTransitionCrossFade: Cross fades two scenes using the CCRenderTexture object. More...
 
class  CCTransitionTurnOffTiles
 CCTransitionTurnOffTiles: Turn off the tiles of the outgoing scene in random order. More...
 
class  CCTransitionSplitCols
 CCTransitionSplitCols: The odd columns goes upwards while the even columns goes downwards. More...
 
class  CCTransitionSplitRows
 CCTransitionSplitRows: The odd rows goes to the left while the even rows goes to the right. More...
 
class  CCTransitionFadeTR
 CCTransitionFadeTR: Fade the tiles of the outgoing scene from the left-bottom corner the to top-right corner.More...
 
class  CCTransitionFadeBL
 CCTransitionFadeBL: Fade the tiles of the outgoing scene from the top-right corner to the bottom-left corner.More...
 
class  CCTransitionFadeUp
 CCTransitionFadeUp: Fade the tiles of the outgoing scene from the bottom to the top. More...
 
class  CCTransitionFadeDown
 CCTransitionFadeDown: Fade the tiles of the outgoing scene from the top to the bottom. More...
 
class  CCTransitionPageTurn
 A transition which peels back the bottom right hand corner of a scene to transition to the scene beneath it simulating a page turn. More...
 
class  CCTransitionProgress
 
class  CCTransitionProgressRadialCCW
 CCTransitionRadialCCW transition. More...
 
class  CCTransitionProgressRadialCW
 CCTransitionRadialCW transition. More...
 
class  CCTransitionProgressHorizontal
 CCTransitionProgressHorizontal transition. More...
 
class  CCTransitionProgressVertical
 
class  CCTransitionProgressInOut
 
class  CCTransitionProgressOutIn
 




Trackback 0 And Comment 0