thanks for the info
If you find the tutorial please send me.
If you find the tutorial please send me.
This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.
Show posts MenuQuote from: Kitty Hello on 2010-Feb-20
Changing textures costs performance. No way to implement that in the new vertex group. I would have to startpoly/endpoly anyway.
Your sprites are big. The fill rate of the iPhone is very limited. I try if I can change the internal texture format to something better, but don't expect too much speed boost.
Quote from: bigsofty on 2010-Feb-19
Slow answer but "media/" in your path should read "Media/"
TYPE tanim
img%
x%
y%
active%
cl%
scalex%
box_col_x% // Box X for collision - player hit
box_col_y% // Box y for collision - player hit
box_col_h% // Box h for collision - player hit
box_col_w%// Box w for collision - player hit
box_atk_x% // Box X for collision - player attack
box_atk_y% // Box y for collision - player attack
box_atk_h% // Box h for collision - player attack
box_atk_w%// Box w for collision - player attack
tx% // UV X Texture
ty% // UV Y Texture
txf%// UV W Texture
tyf%// UV H Texture
ENDTYPE
GLOBAL anim[] AS tanim
DIM anim[2][20][20] // [1] 0,1 player 1 e 2 // [20] num max of animation // [30] num max of frame for single animation
loadsprite "Media/bla0.png",1
loadsprite "Media/bla1.png",2
loadsprite "Media/bla2.png",3
STARTPOLY 1,2 // apply the texture 1
LOCAL c%=RGB(255,255,255)
POLYVECTOR 0, 0, 0,0,c
POLYVECTOR 0,40, 0,40,c
POLYVECTOR 40,20, 40,0,c
POLYVECTOR 40,40, 40,40,c
POLYNEWSTRIP 2 // apply the texture 2
POLYVECTOR 0, 0, 0,0,c
POLYVECTOR 0,40, 0,40,c
POLYVECTOR 40,20, 40,0,c
POLYVECTOR 40,40, 40,40,c
POLYNEWSTRIP 3 // apply the texture 3
POLYVECTOR 0, 0, 0,0,c
POLYVECTOR 0,40, 0,40,c
POLYVECTOR 40,20, 40,0,c
POLYVECTOR 40,40, 40,40,c
ENDPOLY
Quote from: Kitty Hello on 2010-Feb-18
The alpha can be changed with the ALPHAMODE just before the POLYNEWSTRIP. I've not tested it, but that's the way I would expect it.
Multitexturing is not possible. What are you trying to do?
STARTPOLY 0,2
ALPHAMODE -0.8
LOCAL c%=RGB(255,255,255)
POLYVECTOR 0, 0, 0,0,c
POLYVECTOR 0,40, 0,0,c
POLYVECTOR 40,20, 0,0,c
POLYVECTOR 40,40, 0,0,c
POLYNEWSTRIP
ALPHAMODE 0
// same at 100,100
POLYVECTOR 100,100, 0,0,c
POLYVECTOR 100,140, 0,0,c
POLYVECTOR 140,120, 0,0,c
POLYVECTOR 140,140, 0,0,c
ENDPOLY
SHOWSCREEN
MOUSEWAIT
STARTPOLY 0,2
ALPHAMODE 0
LOCAL c%=RGB(255,255,255)
POLYVECTOR 0, 0, 0,0,c
POLYVECTOR 0,40, 0,0,c
POLYVECTOR 40,20, 0,0,c
POLYVECTOR 40,40, 0,0,c
POLYNEWSTRIP
ALPHAMODE -0.8
// same at 100,100
POLYVECTOR 100,100, 0,0,c
POLYVECTOR 100,140, 0,0,c
POLYVECTOR 140,120, 0,0,c
POLYVECTOR 140,140, 0,0,c
ENDPOLY
SHOWSCREEN
MOUSEWAIT
Quote from: matchy on 2010-Feb-15
Export it as .OBJ (with texture coords) from 3ds Max and it won't crash on the iPhone.
TYPE tsfondo
x%
y%
r
g
b
active%
ENDTYPE
GLOBAL sfondo[] AS tsfondo
DIM sfondo[3]
TYPE tpolys
x%
y%
r
g
b
active%
ruota
pivot
ENDTYPE
GLOBAL polys[] AS tpolys
DIM polys[101]
PukeSprite(200,200, 0, 0, 0,240, 160, 0,0,1,255,255,255,0,0)
PukeSprite(201,201, 0, 0, 0,240, 160, 0,0,1,255,255,255,scrolltext,0)
PukeSprite(202,202, 0, 0, 0,240, 160, 0,0,1,255,255,255,scrolltext1,0)
FOR i=1 TO max_sprite
polys[i].ruota = polys[i].ruota + 1
IF polys[i].ruota >= 360 THEN polys[i].ruota = 0
PukeSprite(0,0, 0, 0, polys[i].ruota, polys[i].x, polys[i].y,0,polys[i].pivot,1,polys[i].r,polys[i].g,polys[i].b,0,0)
NEXT
//img1 - number sprite or parallax
//img2 - disable
//rotx - rotate the sprite X
//roty - rotate the sprite y
//rozx - rotate the sprite z
//x - move in x position on the screen
//y - move in y position on the screen
//piv_x - move the pivot in x position on the polyvector to change rotation
//piv_y - move the pivot in y position on the polyvector to change rotation
// scalex - scale the polivector size (zoom effect)
//r - red color
//g - green color
//b- blue color
// scrolltx - scroll the texture in xpos
// scrollty - scroll the texture in ypos
FUNCTION PukeSprite: img1, img2, rotX, rotY, rotZ, x,y, piv_x,piv_y,scalex,r,g,b,scrolltx,scrollty
LOCAL w, h, phi, swap, tx, ty
LOCAL s, c, cl, px, py
GETSPRITESIZE img1, w,h
tx=w
ty=h
phi = MOD(ABS(rotY), 360)
IF phi < 90 OR phi>270
swap = img1
img1=img2
img2=swap
ENDIF
w = w * COS(phi)
phi = MOD(ABS(rotX), 360)
IF phi < 90 OR phi>270
swap = img1
img1=img2
img2=swap
ENDIF
h = h * COS(phi)
s=SIN(rotZ)
c=COS(rotZ)
w=(w/2) *scalex
h=(h/2) *scalex
cl=RGB(255,255,255)
STARTPOLY img1
px=-w-piv_y; py=-h-piv_x; POLYVECTOR x+px*c+py*s, y-px*s+py*c, 0+scrolltx, 0+scrollty,RGB(r,g,b)
px=-w-piv_y; py= h-piv_x; POLYVECTOR x+px*c+py*s, y-px*s+py*c, 0+scrolltx,ty+scrollty,RGB(r,g,b)
px= w-piv_y; py= h-piv_x; POLYVECTOR x+px*c+py*s, y-px*s+py*c, tx+scrolltx,ty+scrollty,RGB(r,g,b)
px= w-piv_y; py=-h-piv_x; POLYVECTOR x+px*c+py*s, y-px*s+py*c, tx+scrolltx, 0+scrollty,RGB(r,g,b)
// and back for back face culling
//px= w-piv_y; py= h-piv_x; POLYVECTOR x+px*c+py*s, y-px*s+py*c, tx,ty,RGB(r,g,b)
//px=-w-piv_y; py= h-piv_x; POLYVECTOR x+px*c+py*s, y-px*s+py*c, 0,ty,RGB(r,g,b)
//px=-w-piv_y; py=-h-piv_x; POLYVECTOR x+px*c+py*s, y-px*s+py*c, 0, 0,RGB(r,g,b)
ENDPOLY
ENDFUNCTION
FUNCTION box:x%,y%,width%,height%,c1%,c2%,c3%,c4%
STARTPOLY 500
POLYVECTOR width%,y%,0,0,c1%
POLYVECTOR x%,y%,0,0,c2%
POLYVECTOR x%,height%,0,0,c3%
POLYVECTOR width%,height%,0,0,c4%
ENDPOLY
ENDFUNCTION
// Animation Demo
// Start: Friday, March 22, 2002
SYSTEMPOINTER TRUE
SETSCREEN 480,320,TRUE
SMOOTHSHADING TRUE
TYPE tMouse
x%
y%
active%
ENDTYPE
// Array to hold mice
GLOBAL mouse[] AS tMouse
DIM mouse[5]
X_LOADOBJ "media/1.ddd", 1
LOADSPRITE "media/player01.jpg", 1
WHILE TRUE
updateMice()
IF mouse[0].active THEN phi=phi+GETTIMER()/100
// IF KEY(208) THEN MOVE = MOVE - 10
X_MAKE3D 1, 1000, 45
X_CAMERA 0, 0, -250 + MOVE, 0, 0, 0
X_SPOT_LT 0, RGB(255,255,255), 0,50,100,0,10,100,180
//phi=phi+GETTIMER()/100
permil=permil+GETTIMER()/20000; IF permil>=1 THEN permil=0
X_ROTATION 180, 1,0,0
X_ROTATION phi, 0,-1,0
X_SETTEXTURE 1,-1
X_DRAWANIM 1, 0, 128, permil, TRUE
GOSUB ShowFPS
PRINT "MOVE" + MOVE,0,20
SHOWSCREEN
WEND
// ------------------------------------------------------------- //
// -=# SHOWFPS #=-
// ------------------------------------------------------------- //
SUB ShowFPS:
X_MAKE2D
dtime=GETTIMER()
fps = ((1000/dtime)+fps)/2
delay=delay+dtime
IF delay>1000 // 1/2 sec
delay=0
fps_draw=fps
ENDIF
PRINT "FPS: "+fps_draw+"px:" + ply_x + " py:" + ply_y + " d:" + ply_dir, 0 ,0
ENDSUB // SHOWFPS
FUNCTION updateMice:
FOR imouse% = 0 TO GETMOUSECOUNT()-1
SETACTIVEMOUSE imouse%
MOUSESTATE mx%, my%, b1%, b2%
mouse[imouse].x=mx
mouse[imouse].y=my
mouse[imouse].active=b1
NEXT
ENDFUNCTION