Something strange in android

Previous topic - Next topic

msx

This APK is the building of my BAS?

Kitty Hello

yes. But with my BMP fix. It works on my device.

matchy

#32
Quote from: msx on 2011-Oct-05
Quote from: caffeinekid on 2011-Oct-05
I have had a report that my Android app only shows half the screen (I think that's what they said I'm trying to clarify) on his HTC Wildfire - perhaps this is the same problem?

Yes, My problem occurs in small resolutions like HTC Wildfire -320x240- (used for my test).


I'm also painfully testing on a borrowed HTC Wildfire won in a raffle.

Crivens

It works on a wildfire? I seem to get White for all sprites. Is it better for new GLB or is it the new phone?

Cheers
Current fave quote: Cause you like musicians and I like people with boobs.

matchy

Note Andoird version < 2.2 = white rgb polys/lines but 3D work/bmp sprites work.

Generally, as an immediate solution as suggested before, if you want fixed coloured lines then just draw thin texture 2D/3D polys!

msx

#35
I think I can confirm that there is a bug that only appears on HTC Wildfire. Attached a video of an HTC Wildfire and the code that is running, you'll notice that the default font of GLB is deformed and progress bar is white but it should be red.




Code (glbasic) Select
GLOBAL NUM, TEMP, TEMP$

SETCURRENTDIR("Media") // seperate media and binaries?

ALLOWESCAPE TRUE

WHILE TRUE
NUM=10
FOR I=1 TO NUM

MSG_Obteniendo_Datos()
//Progress Bar (RED Colour)
DRAWLINE 59,250,260,250,RGB(255,127,0)
DRAWLINE 59,262,260,262,RGB(255,127,0)
DRAWLINE 59,250,59,262,RGB(255,127,0)
DRAWLINE 260,250,260,262,RGB(255,127,0)
TEMP=200/(NUM+1)
FOR J=1 TO (I*TEMP)
DRAWLINE 59+J,251,59+J,262,RGB(255,0,0)
NEXT
SHOWSCREEN
Pause(200)
NEXT

WEND

FUNCTION MSG_Obteniendo_Datos:
ALPHAMODE -1
TEMP$="OBTENIENDO DATOS, POR FAVOR ESPERE..."
PRINT TEMP$,160-(LEN(TEMP$,1)/2),168,1
TEMP$="GETTING INFORMATION, PLEASE WAIT..."
PRINT TEMP$,160-(LEN(TEMP$,1)/2),208,1

ENDFUNCTION

FUNCTION Pause%: delay%
  LOCAL time_start% = GETTIMERALL()
  WHILE ABS(GETTIMERALL() - time_start) < delay
    FOR i=1 TO 1000; NEXT
  WEND
ENDFUNCTION

MrTAToad

I mentioned earlier this year that the Wildfire can't handle coloured RECTS - you need to use POLYVECTOR...

msx

and what about the texts unreadable?

Minion

You could always write your own print routines that use polyvector ;)

msx

I need an example.

Thanks

AlienMenace

I thought I'd take a stab at it, give this a try...

Code (glbasic) Select

// --------------------------------- //
// Project: PolyFont BY GulfRacer
// Start: Sunday, October 16, 2011
// IDE Version: 10.106

LOCAL screen_x, screen_y
GETSCREENSIZE screen_x, screen_y

SETCURRENTDIR("Media")
LOADSPRITE "font.png",1000 // LOAD YOUR FONT AS A SPRITE

WHILE TRUE

PrintPoly("** This is a PrintPoly test! **",screen_x/2, 100, 1000, RGB(255,0,0),1) // WARNING: USE COLOR RGB(255,255,255) FOR MOBILE DEVICES
PrintPoly("This text is centered!",screen_x/2,150,1000, RGB(0,255,0),1)
PrintPoly("This text is not!",screen_x/2,200,1000, RGB(0,0,255),0)

SHOWSCREEN
WEND

FUNCTION PrintPoly: text$, x, y, font, color, center
LOCAL font_sizex, font_sizey, char_row, char_col, text_length
LOCAL loop_foo, cur_char$, cur_char_code
LOCAL texture_x, texture_y, cols, rows, center_x=0

text_length=LEN(text$)

IF text_length>0

GETSPRITESIZE font,font_sizex,font_sizey

cols=font_sizex/16 // GET THE COLUMN SIZE IN PIXELS
rows=font_sizey/8 // GET THE ROW SIZE IN PIXELS

IF center=1 THEN center_x=text_length*cols/2

FOR loop_foo=0 TO text_length-1

cur_char$=MID$(text$,loop_foo,1) // GET THE CURRENT CHARACTER
cur_char_code=ASC(cur_char$) // GET THE CURRENT CHARACTER CODE
char_row=INTEGER(cur_char_code/16) // FIND THE ROW IN THE FONT MATRIX THE CHARACTER BELONGS TO
char_col=INTEGER(MOD(cur_char_code,char_row*16)) // FIND THE COLUMN IN THE FONT MATRIX THE CHARACTER BELONGS TO
texture_x=char_col*cols // LOCATE THE TEXTURE PIXEL X LOCATION IN THE FONT MATRIX
texture_y=char_row*rows // LOCATE THE TEXTURE PIXEL y LOCATION IN THE FONT MATRIX

STARTPOLY font
       
        POLYVECTOR x-center_x+(loop_foo*cols),y,texture_x,texture_y,color
        POLYVECTOR x-center_x+(loop_foo*cols),y+rows,texture_x,texture_y+rows,color
        POLYVECTOR x-center_x+(loop_foo*cols)+cols,y+rows,texture_x+cols,texture_y+rows,color
        POLYVECTOR x-center_x+(loop_foo*cols)+cols,y,texture_x+cols,texture_y,color
       
ENDPOLY

NEXT

ENDIF

ENDFUNCTION



Apps published: 3

Minion

Code (glbasic) Select

FUNCTION Prontsc:a$,x,y,cl,cl2,scx,scy

// x,y     - Center point of text
// cl      - top colour of text
// cl2     - bottom colour of text
// scx,scy - Scaling factor for text (1 = normal, 2 = double size, 0.5 = half size etc)

// Needs bitmap font loaded into sprite id 1000 (Use GLBs Font creator to make, or use other bitmap font)
// size of font needs to be 32x32, 16 chars accross, 8 down

LOCAL xx,yy,a,Nm
LOCAL nx,ny,nx2,ny2

Nm=LEN(a$)-1
STARTPOLY 1000,2
FOR m=0 TO Nm

a=ASC(MID$(a$,m,1))

yy= INTEGER((a/16))*32
xx= MOD(a,16)*32


nx=(((m*2)-Nm)-1)*(16*scx)
nx2=((((m+1)*2)-Nm)-1)*(16*scx)
ny=16*scy
ny2=16*scy

POLYVECTOR x+nx,y-ny,   xx,yy,       cl
POLYVECTOR x+nx,y+ny,   xx,yy+32,    cl2
POLYVECTOR x+nx2,y-ny,  xx+32,yy,    cl
POLYVECTOR x+nx2,y+ny,  xx+32,yy+32, cl2

NEXT
ENDPOLY

ENDFUNCTION



msx

Thank you. I get it. It has helped me.