Menu

Show posts

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 Menu

Topics - chve

#1
I have seen that in GLBasic is easy to understand how types works.

I always usea arrays instead types, but I would like to know when do you see it is better use types than arrays, becouse I dont see any diference.

Cant someone post an explanation and/or an example which shows when it is better use types than arrays?

Thanks   :)
#2
I have seen that three times I have created a new proyect with spaces at end of name proyect, for example "my proyect  ", afterwards, I cannot delete this folder, becouse windows does not reconize this folder and apperars message "No se puede encontar este elemento", which  english should be samething as: "I cannot find this element".

I cannot delete those thre folders anyway, not even rename o move or copy and paste to any other place.

I have three folders so, an I will be more carefull to avoid create new proyects withs characters spaces and end of its name.

It is not something serius and I leave those folders "alone" in a its place rip  :D.

I have GLBasiic premium
and my computer is

Windows 7x64 home premium7, Spanish.
model: Asus Notebook N61jq series

Memory ram 4 GB

Card graphic ATI mobilty radeon HD 5730
Memory of graphic card aprox. 2768
#3
Hay un problema que tengo al crear la carpeta del proyecto que es  que si el nombre de la carpeta termina con algun espacio en blanco, por ejemplo una carpeta que nombre "Mousehit events " con un espacio en blanco al final,  no hay manera no de borrarla ni de renombrarla. Sale el mensaje del windows ,"No se pudo encontrar este elemento"   :help:

Ya me ha pasado con tres carpetas.

¿Alguien sabe como resolver esto? parece un bug del IDE del GLBasic al crear carpetas.

Gracias!  ;)
#4
Pues eso, ya tenia escrita esta function, pero en otro lenguaje y con bugs. :rant:

Y la reescribi para GLBasis y parece que funciona bin y sin errores (o eso creo)
Las functiones que devuelven el  rgb las agarre  del foro porque no vi otro modo mejor  :D
Code (glbasic) Select


// --------------------------------------------------------------------------------;
//                       --- Function   Zoom  ---                                  ;
// --------------------------------------------------------------------------------;
//                                                                                 ;
// Zoom (xm,ym,xstartgrid,ystartgrid,wbox,hbox,xnumgrid,ynumgrid,border,exborder)  ;
// xmpix <------------------ X mouse/pixel Position                                ;
// ympix <------------------ Y mouse/pixel Position                                ;
// xstartgrid <-------------- Position X left up start Zoom                        ;
// ystartgrid <-------------- Position Y left up start Zoom                        ;
// wbox <---------------- X Size IN pinxels of Each box IN zoom                    ;
// hbox <---------------- Y Size IN pinxels of Each box IN Zoom                    ;
// xnumgrid <------------ Amount of X boxes IN Zoom                                ;
// ynumgrid <------------ Amount ofY  boxes IN Zoom                                ;
// border <-------------- Size IN pinxels of border                                ;
// exborder <------------ exterior border                                          ;
//---------------------------------------------------------------------------------;

FUNCTION zoom: xmpix, ympix, xstartgrid, ystartgrid, wbox, hbox, xnumgrid, ynumgrid, border,exborder
LOCAL widegrid, heightgrid, xcurs, ycurs, xpix, ypix
LOCAL xborder, yborder
LOCAL xzoom, yzoom, posx, posy
    STATIC numx=1 ,numy=1, timerfrm, timercolor

//-------------------------------------------------------------------------

timerfrm=timerfrm+GETTIMER()
IF timerfrm >= 399.0
  timerfrm = timerfrm - 399.0
  INC timercolor, 1
  IF timercolor > 2 THEN timercolor = 1
  //PRINT "tiempo paso!!!  "+timercolor ,100,100,RGB(0,5,55)
ENDIF


widegrid=wbox*xnumgrid+xnumgrid*border ;  heightgrid=hbox*ynumgrid+ynumgrid*border

xpix=xmpix ; ypix=ympix
posx = xstartgrid
posy = ystartgrid

// DRAWRECT xmpix,ympix,xnumgrid, ynumgrid, RGB (0,255,255)     //un recuadro  del Zoom que se escanea. Es un cuadrado fijo
DRAWLINE xmpix, ympix-1, xmpix+xnumgrid,ympix-1, RGB(0,255,255)                             // horizontal - arriba
DRAWLINE xmpix+xnumgrid, ympix, xmpix+xnumgrid,ympix+ynumgrid , RGB(0,255,255)          // vertical - derecha
DRAWLINE xmpix, ympix+ynumgrid, xmpix+xnumgrid,ympix+ynumgrid,  RGB(0,255,255)          // Horizontal - abajo
DRAWLINE xmpix-1, ympix, xmpix-1 ,ympix+ynumgrid, RGB(0,255,255)                            // vertical - izquierda

    DRAWRECT xstartgrid-exborder-border,ystartgrid-exborder-border,widegrid+exborder*2+border,heightgrid+exborder*2+border, RGB (0,255,255) //el borde exterior
IF border> 0 THEN DRAWRECT xstartgrid-border,ystartgrid-border,widegrid+border,heightgrid+border, RGB (20,95,30)             // la rejilla interna


FOR ax=1 TO ynumgrid                     //Read pinxels for drawing grid
xpix=xmpix
posx=xstartgrid
FOR bx=1 TO xnumgrid
// dibuja el borde
IF border> 0 THEN DRAWRECT posx-1, posy-1,wbox+2,hbox+2,  RGB(50,50,50)

col% = GETPIXEL(xpix, ypix)

r=(col%)
g=(col%)
b=(col%)
a=(col%)

rgbr(r)
rgbg(g)
rgbb(b)
rgba(a)

DRAWRECT posx,posy,wbox,hbox,  RGB(red,green,blue)
posx=posx+wbox+border

INC xpix,1
NEXT

posy= posy+hbox+border
INC ypix,1
NEXT

xpix=xmpix+numx-1 ; ypix=ympix+numy-1

IF KEY(205)=1 AND numx < xnumgrid THEN numx=numx+1 ; INC xpix,1   // mover el cursor derecha
IF KEY(203)=1 AND numx > 1 THEN numx=numx-1 ; DEC xpix, 1          // mover el cursor izquierda
IF KEY(208)=1 AND numy < ynumgrid THEN numy=numy+1 ; INC ypix,1   // mover el cursor arriba
IF KEY(200)=1 AND numy > 1 THEN numy=numy-1 ;DEC ypix, 1           // mover el cursor abajo

col% = GETPIXEL(xpix,ypix)

r=(col%)
g=(col%)
b=(col%)
a=(col%) // esto no lo uso


rgbr(r)
rgbg(g)
rgbb(b)
rgba(a) // esto no lo uso


IF timercolor=1 THEN SETPIXEL xpix,ypix, RGB(255,255,255)    // el pinxel que se escanea
            IF timercolor=2 THEN SETPIXEL xpix,ypix, RGB(255,green,blue) // el pinxel que se escanea

xzoom=xstartgrid
yzoom=ystartgrid


//las zonas para picar con el raton
xmpix=mx ; ympix=my
xborder=0 ; yborder=0
FOR k=1 TO xnumgrid
yborder=0 ; yzoom=ystartgrid
FOR j=1 TO ynumgrid

IF xmpix>xzoom AND xmpix<xzoom+wbox AND ympix> 0+yzoom AND ympix<yzoom+hbox AND b1=1
numx=k ; numy=j
xpix=k ; ypix=j

//DRAWRECT xborder+xstartgrid,yborder+ystartgrid,wbox,hbox , RGB(255,255,255)

j=xnumgrid ; k=ynumgrid
ENDIF
yzoom=yzoom+hbox+border
yborder=yborder+hbox+border

NEXT

xzoom=xzoom+wbox+border
xborder=xborder+wbox+border
NEXT


xcurs=0                           // calculo de posicion del 'cursor'
FOR M=1 TO xnumgrid
IF M=numx THEN xzoom=xstartgrid+xcurs
xcurs=xcurs+wbox+border
NEXT
ycurs=0
FOR N=1 TO ynumgrid
IF N=numy THEN yzoom=ystartgrid+ycurs
ycurs=ycurs+hbox+border
NEXT

  IF timercolor=1
     DRAWRECT xzoom-1,yzoom-1,wbox+2,hbox+2,RGB(255,0,128)  // el recuadro del grid
     DRAWRECT xzoom,yzoom,wbox,hbox,RGB(red,green,blue)
  ENDIF
  IF timercolor=2
  DRAWRECT xzoom-1,yzoom-1,wbox+2,hbox+2,RGB(80,80,255)
  DRAWRECT xzoom,yzoom,wbox,hbox,RGB(0,0,0)
  ENDIF


DRAWRECT xstartgrid-exborder-border,ystartgrid+heightgrid+exborder,widegrid+exborder*2+border,54, RGB(25,5,255) // El recuadro de texto
PRINT  " X = " + xpix+ " Y = "+ ypix+ "    Cursor X = " + numx + "  Cursor Y = " + numy , xstartgrid+1,ystartgrid+heightgrid+exborder+border+2,RGB(0,5,55)
PRINT " Color: "+ col% ,  xstartgrid+1,ystartgrid+heightgrid+exborder+border+18, RGB(0,5,55)
PRINT " Red: "+ red  + "  Green: " + green + "  Blue: " + blue + " alpha: "+ alph ,xstartgrid+1,ystartgrid+heightgrid+exborder+border+34,RGB(0,5,55)

ENDFUNCTION

//*************************************
//Function rgbr(col) - return the red component of a 32 bit colour
//*************************************
FUNCTION rgbr: col%
red=bAND(col%,0xff)
RETURN red
ENDFUNCTION
//*************************************
//Function rgbg(col) - return the green component of a  32 bit colour
//*************************************
FUNCTION rgbg: col%
green=bAND(col%/0x100,0xff)
RETURN green
ENDFUNCTION
//*************************************
//Function rgbb(col) - return the blue component of a  32 bit colour
//*************************************
FUNCTION rgbb: col%
blue=bAND(col%/0x10000,0xff)
RETURN blue
ENDFUNCTION
//*************************************
//Function rgba(col) - return the alpha component of a  32 bit colour
//*************************************
FUNCTION rgba: col%
alph=bAND(col%/0x1000000,0xff)
RETURN alph
ENDFUNCTION





Y aqui para probarla con media:
http://www.4shared.com/file/QjAx_LXs/Zoom_function.html

Tambien aqui "coji prestado" algo del foro algo de  :D de Hemlos http://www.glbasic.com/forum/index.php?topic=3917.msg28705#msg28705   para poner limites de tiempo. Todo lo demas lo escribi yo.
Y me construi una subrutina para salvar screenshot que no acaba de funcionar aun bie jiji


Si no os parece gran cosa, tendriais que ver todo  lo demas que he hecho que es aun peor y muy lioso  :D

Una de las cosas mas dificiles que encuentro al programar, es definir el nombre de cada variable correctamente, para evitar hacerme un lio!!
#5
En la pagina "Shop" de www.glbasic.com veo dos versiones que se pueden comprar del GLBasic.
Me podria alguien aclarar que diferencia hay entre comprar en la tienda GLBasic una version u otra.

1 - PayPal - GLBasic SDK por 80 euros
2 -  GLBasic SDK - premium 89 euros

Supongo que la version "free" se convertira en "premium" al añadirle el "license code"
Yo por si acaso compraria la mas cara, pero mejor pregunto  que es lo mas conveniente:)

Gracias!
#6
Hola, hay algo que me gustaria saber acerca de los copyrights, especialmente de dibujos.

Pues vereis a mi se me da bien el dibujo auque no dibujo mucho porque actualmente me gusta mas programar que dibujar con el ordenador.

Y estoy haciendo unos clips de dibujos para un programa que estoy haciendo y cuestan mucho trabajo aunque se vean muy simples, pues los hago pinxel a pinxel y controlando los colores para que el programa en que van a ser usado, los detecte. Es en concreto la baraja del tarot, las 22 cartas de las cuales tengo ya dibujadas 18. Asi, si hago un programa de cartas con esos graficos mios, nadie podra decir que use algo o graficos ilegales o con copyright de otro/s.

Lo que quiero decir, es que aunque sean dibujos simples son mis dibujos y no me gustaria que nadie se los apropiase y tuviese el derecho a usarlos y yo no.
No me importa que otros los use, lo unico que quiero es que si los usa, sigan siendo mios. Ni siquiera quiero creditos.
¿Hay alguna manera segura de compartirlos SIN que dejen de ser mios, o los sigo guardando en mi PC por los siglos de los siglos amen?

El avatar que uso ahora es uno de mis dibujitos, no del tarot, sino de la espada o tridente de paracelso, por supuesto, aunque pierde mucho asi.

Cualquier consejo lo agradezco  :)

#7
Off Topic / Hello
2011-Oct-22
Hi, I am from Spain.

Actually I use Blitz3D for programing and I am happy with it, but I have decided test GLBasic, a language that seems to be very interesting becouse can be used in varius targets as Android, iPhone, Windows, etc. (and a lot of others figures I have to test still!)

IDE of GLBasic is very nice and comfortable.

Actualy, I am using demo of GLBasic for test and learn this nice language.

I am some confused becouse not all commands are in GLBasic IDE are as I see in forum or help file. But I think this is for to be a free version or demo.

I am very adicct to programing and it is a hobby for me.

Regards