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

Messages - DmitryK

#31
"Nokia and Microsoft Announce Plans for a Broad Strategic Partnership to Build a New Global Mobile Ecosystem"
http://www.microsoft.com/presspass/press/2011/feb11/02-11partnership.mspx
#32
wow super effect  :blink:
#33

I can translate your texts to Russian
Do you have a deadline for that ? :)

#34

Great !!!

I'v being finished my first game and also need a new phone, why not webos based.
#35
Serpent, thank you for sharing your experience
I didn't try your way before since GIMP and Paint.net are usually enough for me
But I will try and this way to compare results
#36
Albert, thank you for sharing that!

this is my five cents, hope it'll be useful:

1. I changed "button" function for sprite support
if you don't send last param "image" (sprite id) the function works as before
also text is horizontal centered now

2. I joined sliderh and sliderv fuctions to one - slider
now slider can be any width (not only 16), both width and height are sent as params
also added sprite support - two last params

Code (glbasic) Select
//Button widget (clickable)
FUNCTION button: id, x, y, _width, _height, color, text$, image=-1 //new   image - sprite id
LOCAL fw, fh
LOCAL width, height // new

//new---------------------------------
IF image=-1
  width = _width
height = _height
ELSE
GETSPRITESIZE image, width, height
ENDIF
//end new-----------------------------

GETFONTSIZE fw, fh

IF gui.hotitem = id
IF (gui.activeitem = 0 AND gui.mouselclick)
gui.activeitem = id
ENDIF
ENDIF
IF gui.inregion(x,y,width,height)
gui.prehotitem = id
ENDIF
IF gui.kbditem = 0
gui.kbditem = id
ENDIF

    // selected outline draw
IF gui.kbditem = id AND image=-1 //change -> AND image=-1
DRAWRECT x-1, y-1, width+4, height+4, RGB(255, 0, 0)
ENDIF

    IF gui.kbditem = id AND image=-1 //change
DRAWRECT x+1, y+1, width, height, RGB(0, 0, 0)
ENDIF

IF gui.hotitem = id
IF gui.activeitem = id
  IF image=-1 //new
  DRAWRECT x+2, y+2, width, height, RGB(255, 255, 255)
  ELSE // new
    ALPHAMODE -0.8
DRAWSPRITE image, x+2, y+2 //new
  ENDIF // new
ELSE
  IF image=-1 //new
DRAWRECT x, y, width, height, RGB(255, 255, 255)
  ELSE
    ALPHAMODE -1
    DRAWSPRITE image, x, y //new
  ENDIF
ENDIF
ELSE
  IF image=-1 //new
DRAWRECT x, y, width, height, color
  ELSE
    ALPHAMODE -0.8
    DRAWSPRITE image, x, y //new
  ENDIF
ENDIF

PRINT text$,  x+(width-LEN(text$,TRUE))/2, y+(height-fh)/2, TRUE //change -> x+(width-LEN(text$,TRUE))/2

//KBDITEM stb...
IF gui.kbditem = id
IF gui.tab = 1
gui.kbditem = 0
IF gui.shift THEN gui.kbditem = gui.lastwidget
gui.tab = -1
ENDIF
IF gui.keyentered$="\n" //ENTER
RETURN 1
ENDIF
ENDIF

gui.lastwidget = id

IF gui.mouselclick = 0 AND gui.hotitem = id AND gui.activeitem = id THEN RETURN 1

RETURN 0
ENDFUNCTION

//slider widget (vertical and horizontal)
FUNCTION slider: id, x, y, _width, _height, maximum, BYREF value, slider_image=-1, pointer_image=-1
STATIC marginH = 2
STATIC marginW = 2

//new-----------------------------------
LOCAL width, height, val, mousepos, xpos, ypos, slider_size, pointer_size, slider_h // true, false

IF slider_image=-1
  width = _width
height = _height
ELSE
GETSPRITESIZE slider_image, width, height
GETSPRITESIZE pointer_image, pointer_size, pointer_size
ENDIF

IF width >= height // horizontal slider
  slider_h = TRUE
  slider_size = width
  IF slider_image=-1 THEN pointer_size = height - marginH*2
  xpos = ((width-pointer_size -marginW*2) * value) / maximum
  ypos = 0
ELSE               // vertical slider
  slider_h = FALSE
  slider_size = height
  IF slider_image=-1 THEN pointer_size = width - marginW*2
  xpos = 0
  ypos = (height-pointer_size - marginH*2) - ((height-pointer_size - marginH*2) * value) / maximum
ENDIF
//end new ------------------------------

IF gui.hotitem = id
IF (gui.activeitem = 0 AND gui.mouselclick)
gui.activeitem = id
ENDIF
ENDIF
IF (gui.inregion(x,y, width, height))
gui.prehotitem = id
ENDIF
IF gui.kbditem = 0
gui.kbditem = id
ENDIF

    //selected outline draw
IF gui.kbditem = id AND slider_image=-1 THEN DRAWRECT x-1, y-1, width+2, height+2, RGB(255, 0, 0)

    //slider itself draw
    IF slider_image=-1 THEN DRAWRECT x, y, width, height, RGB(50, 50, 50)

    // pointer draw
IF (gui.activeitem = id OR gui.hotitem = id)
  IF slider_image=-1
DRAWRECT x+marginW + xpos, y+marginH + ypos, pointer_size, pointer_size, RGB(255,255,255) //change
  ELSE
    ALPHAMODE -1
    DRAWSPRITE slider_image, x, y
    DRAWSPRITE pointer_image, x+marginW + xpos, y+ypos
  ENDIF
ELSE
  IF slider_image=-1
DRAWRECT x+marginW + xpos, y+marginH + ypos, pointer_size, pointer_size, RGB(200,200,200) //change
  ELSE
    ALPHAMODE -0.8
    DRAWSPRITE slider_image, x, y
    DRAWSPRITE pointer_image, x+marginW + xpos, y+ypos
  ENDIF
ENDIF

    //keyboard management
IF gui.kbditem = id
IF gui.tab = 1
gui.kbditem = 0
IF gui.shift THEN gui.kbditem = gui.lastwidget
gui.tab = -1
ENDIF
IF gui.left = 1 OR gui.down = 1 //change
IF (value > 0)
DEC value, maximum/slider_size //change -> maximum/slider_size
IF value < 0 THEN value = 0
RETURN 1
ENDIF
ENDIF
IF gui.right = 1 OR gui.up = 1
IF (value < maximum)
INC value, maximum/slider_size //change -> maximum/slider_size
IF value > maximum THEN value = maximum
RETURN 1
ENDIF
ENDIF
ENDIF

gui.lastwidget = id

    //mouse management
IF gui.activeitem = id
IF slider_h //new
mousepos = gui.mousex - (x+marginW)
ELSE
mousepos = gui.mousey - (y+marginH)
ENDIF
IF (mousepos < 0) THEN mousepos = 0
IF (mousepos > slider_size) THEN mousepos = slider_size
IF slider_h //new
  val = (mousepos*maximum) / slider_size // for horiz
ELSE
  val = (slider_size-(mousepos*maximum)) / slider_size //for vert
ENDIF
IF (val <> value)
value = val
RETURN 1
ENDIF
ENDIF

RETURN 0
ENDFUNCTION




[attachment deleted by admin]
#37
maybe..., but I'm not a theorist and my goal was a result (good looking fonts inside GLBasic) and I've got it :)
#38
GLBasic - en / Fonts deal
2010-Dec-20
Hi all

Tryind to use fonts produced with a native GLBasic font tool DiNGSFont and after some external font builders usage I finally IMHO descovered a good solution to get nice looking fonts:
1. Make a font in DiNGSFont with ANY proper background color,  with anti alias (and shadow or outline if you want)
2. Save a file as .png
3. Open the file in GIMP (I have 2.6.6) and convert your image's background color to alpha (color\color to alpha-channel), save it to the same .png (or another if you like :) )

that's all :)

Dmitry
#39
oh, you ~ on the half way to DDGui with its 3600 lines :)

I plan to make a simple inplace GUI just for my coming match-3 game
and then will see

   
#40
yea, it's really nice !
Slydog, how many lines of code you had to write ?
#41
thank you for your answers
I will try to find a way to avoid the limitation
#42
to be more clear I attached 2 pictures
1. as is - old_slider.jpg
2. as I want to be - new_slider.jpg (as example)


[attachment deleted by admin]
#43
Hello Kitty!

1. I'm trying to make another look for a slider component (I just want to use bitmap for it) but with no success
function DDgui_draw_user% gets id$, width%, height%, ytop%
but within it I have to send ddgui_vals, wdg, ytop% to new function DDgui_drawslider2
what is the right way I can do it ?

2. could you disclose your plans about DDGui's skining functionality, please ?

best regards,
Dmitry
#44
Hi KidNovak!

GLBasic hasn't its own level editor (as I know), GLBasic is a compiler (and a code editor and ...much more).

But as a Game Maker user in the past and GLB user now I can say that to make your own level editor for your concrete small (if it is) project is a very easy task.
I spent about 2 days to make such for "Hidden object" game in GM7|8.
And ~ 1 day to make such for "Match 3" game in GLB.

Another way - to use external level editor and import maps into GLB.
I see somewhere on the forum info about LE for RPG.

Best regards,
Dmitry