2014년 10월 27일 월요일

세계각국정보 - 나중에 필요할지도.

http://blog.daum.net/_blog/BlogTypeView.do?blogid=0UhXk&articleno=1989&admin=&refequery=%EF%BF%BD%EB%A9%B8%EF%BF%BD%EF%BF%BD%EF%BF%BD%EF%BF%BD%EF%BF%BD%EF%BF%BD%EB%82%AB

2014년 10월 24일 금요일

flash 게임 샘플 &로직 배울수 있는곳

http://www.emanueleferonato.com/

2014년 10월 22일 수요일

[Android] 안드로이드 잠금화면(LockScreen) 만들기 기초1

http://ccdev.tistory.com/16 ㅈㅏㅁ금화면 ,부팅시 실행서비스 등 좋은 샘플이 있네요.

2014년 10월 7일 화요일

두 박스간 스케일 비율 계산

this.percentageBetweenContainer=function( argContainer ) {
var  pntContainer=argContainer;


var floatXScale=1.0;
var floatYScale= 1.0;
var floatRet=1.0;


if(  pntContainer.w  > posBounds.w &&  pntContainer.h  > posBounds.h ){
return floatRet;
}


floatXScale=(pntContainer.w)/(posBounds.w);
floatYScale=(pntContainer.h)/(posBounds.h);

if(floatXScale<floatYScale){
floatRet=floatXScale;
}else{
floatRet=floatYScale;
}
return floatRet;
}

두 박스 간의 겹침 % 계산하는 로직- 따온거임.

http://forum.ragezone.com/f144/total-overlapping-percent-2-rectangles-895041/

-func-
function rectCollisionPercentage(argRectA,argRectB){
/*
* argRectA = {x:0, y:0, r width:100, height:100};
* argRectB ={x:0, y:0, r width:100, height:100};
*/
var r1 = {
left:argRectA.x,
top:argRectA.y,
right:argRectA.x+argRectA.width-1,
bottom:argRectA.y+argRectA.height-1,
width:argRectA.width,
height:argRectA.height
};

var r2 = {
left:argRectB.x,
top:argRectB.y,
right:argRectB.x+argRectB.width-1,
bottom:argRectB.y+argRectB.height-1,
width:argRectB.width,
height:argRectB.height
};

// console.log(r1,r2);

var left = r1.left >= r2.left ? r1.left : r2.left;
var top = r1.top >= r2.top ? r1.top : r2.top;
var right = r1.right >= r2.right ? r2.right : r1.right;
var bottom = r1.bottom >= r2.bottom ? r2.bottom : r1.bottom

var overlapHeight = bottom - top;
var overlapWidth = right - left;

var r2Area = r2.height * r2.width;
var overlapArea = overlapHeight * overlapWidth;

var oPercent  = (Math.round((overlapArea / r2Area ) * 100)) * 1.414;
console.log(oPercent);
return oPercent;

}

-use-

opatrans=rectCollisionPercentage(

{ x:boundOutBoxContainer.x,
y:boundOutBoxContainer.y,
width:mainAblumViewFlipper.getOutBoundWH().w,
height:mainAblumViewFlipper.getOutBoundWH().h } ,

{ x:( arg_newBitmapConteiner.x + ((vvAlbumList.container.getChildByName("vAlbumSubList").x)) ),
y:arg_newBitmapConteiner.y,
width:mainAblumViewFlipper.getInBoundBaseWH().w,
height:mainAblumViewFlipper.getInBoundBaseWH().h }

);

2014년 10월 6일 월요일

Android code snippets ^^

http://www.technotalkative.com/tag/android-code-snippets/page/1/