1. NSArray* familys = [UIFont familyNames];  

  2. for (int i = 0; i<[familys count]; i++) {  

  3.     NSString* family = [familys objectAtIndex:i];  

  4.     NSLog(@"\r\n\r\nFontfamily:%@\r\n=====",family);  

  5.     NSArray* fonts = [UIFont fontNamesForFamilyName:family];  

beanway 發表在 痞客邦 留言(0) 人氣()

http://www.slideshare.net/littlebtc/git-5528339

beanway 發表在 痞客邦 留言(0) 人氣()

http://gamerboom.com/archives/32002

beanway 發表在 痞客邦 留言(0) 人氣()

很多obj c 的 demo

http://www.supersuraccoon-cocos2d.com/2011/09/17/sticky-demo-resource-list-keep-updating/

beanway 發表在 痞客邦 留言(0) 人氣()

void ccFillPoly( CGPoint *poli, int points, BOOL closePolygon )
{
// Default GL states: GL_TEXTURE_2D, GL_VERTEX_ARRAY, GL_COLOR_ARRAY, GL_TEXTURE_COORD_ARRAY
// Needed states: GL_VERTEX_ARRAY,
// Unneeded states: GL_TEXTURE_2D, GL_TEXTURE_COORD_ARRAY, GL_COLOR_ARRAY

beanway 發表在 痞客邦 留言(0) 人氣()

NSString *myNSString1 = [NSString stringWithUTF8String:"Hello"];

NSString *myNSString2 = [NSStringstringWithCString:"Hello"encoding:NSASCIIStringEncoding];

NSLog(@"myNSString1=%@",myNSString1);

NSLog(@"myNSString2=%@",myNSString2);

constchar *cstring=[myNSString2 cStringUsingEncoding:NSUTF8StringEncoding];

beanway 發表在 痞客邦 留言(0) 人氣()

-(void)draw{

CGSize s = [[CCDirectorsharedDirector] winSize];

glDisable(GL_LINE_SMOOTH);

glLineWidth( 5.0f );

glColor4ub(255,0,0,255);

beanway 發表在 痞客邦 留言(0) 人氣()

DeviceDetection import進來後就可直接使用,非常方便的工具

#import "DeviceDetection.h"

@implementation DeviceDetection

+ (uint) detectDevice {

NSString *model= [[UIDevice currentDevice] model];

beanway 發表在 痞客邦 留言(0) 人氣()

/* cocos2d for iPhone
*
* http://www.cocos2d-iphone.org
*
* Copyright(C) 2009 JasonBooth

beanway 發表在 痞客邦 留言(0) 人氣()

-(CCTexture2D*) UIImageToCCTexture2D

{

CGSize s = [[CCDirectorsharedDirector] winSize];

UIImage *image = [[UIImagealloc] initWithContentsOfFile:[CCFileUtilsfullPathFromRelativePath: @"test_image.png" ]];

CGImageRef imageref = [image CGImage];

beanway 發表在 痞客邦 留言(0) 人氣()

目前圖只做橫的切割,從第幾張開始到第幾張結束。

+(CCAnimation*)getAnimation:(NSString*)s wCount:(int)wc startFrame:(int)sf endFrame:(int)ef{

CCTexture2D *texture =[[CCTextureCachesharedTextureCache] addImage:s];

float imageWidth=texture.contentSize.width/wc;

float imageHeight=texture.contentSize.height;

beanway 發表在 痞客邦 留言(0) 人氣()

[webView loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:@"http://www.apple.com"]]];
[WebView loadRequest:[NSURLRequest requestWithURL:[NSURL fileURLWithPath:[[NSBundle mainBundle] pathForResource:@"index" ofType:@"html"]isDirectory:NO]]];
[WebView loadHTMLString:@"<img src=test.png>" baseURL:[NSURL fileURLWithPath:[[NSBundle mainBundle] bundlePath]]];

beanway 發表在 痞客邦 留言(0) 人氣()

1 2 3
Blog Stats
⚠️

成人內容提醒

本部落格內容僅限年滿十八歲者瀏覽。
若您未滿十八歲,請立即離開。

已滿十八歲者,亦請勿將內容提供給未成年人士。