### Author Topic: Manga Background  (Read 4803 times)

#### Kitty Hello

• code monkey
• Prof. Inline
• Posts: 10760
• here on my island the sea says 'hello'
##### Manga Background
« on: 2006-Jan-04 »
Ever wondered how to draw a inclined mange background - for a highscore table e.g.?
Here's a short mehtod, that wastes some CPU power - if you mind, change it.

Code: (glbasic) [Select]
`FILLRECT 0,0, 150,100,RGB(40,70,220)FILLRECT 0,0, 142,41,RGB(40,220,40)PRINT "GLBasic", 3,3GRABSPRITE 0, 1,1,150,46BLACKSCREENWHILE TRUE MenuBkgRot(0, 32.5, 20) SHOWSCREENWENDFUNCTION MenuBkgRot: id, phi, speedLOCAL dx, dy, rx, ry, bx, by, sx, sy, ox, gox GETSPRITESIZE id, bx, by IF bx=0 OR by=0 THEN RETURN bx=bx+2 by=by+3 dx = COS(phi)*bx dy = - SIN(phi)*bx rx = SIN(phi)*by ry =   COS(phi)*by GETSCREENSIZE sx, sy bx = INTEGER(sx/bx)*2 by = INTEGER(sy/by)*2 gox = MOD(-GETTIMERALL() * speed, 10000)/10000 FOR y=-by TO by ox = MOD(y,2)/2 + gox FOR x=-bx TO bx ROTOSPRITE id, (x+ox)*dx+y*rx, (x+ox)*dy+y*ry, phi NEXT NEXTENDFUNCTION`and that's all of it. Have fun.

#### goomoo

• Guest
##### Manga Background
« Reply #1 on: 2006-Mar-19 »
Cool,Thanks Gernot!