Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

AppGameKit Classic Chat / DrawText? DrawImage?

Author
Message
PartTimeCoder
AGK Tool Maker
9
Years of Service
User Offline
Joined: 9th Mar 2015
Location: London UK
Posted: 15th Apr 2017 21:20
now I know these are pretty fundamental functions to have in any game making language but AppGameKit does not seem to have them, I'm sure Paul didnt drop the ball and leave out these 2 very useful functions so I'm convinced there must be a way ... but finding it, I want to just 'Draw' the output, not have to use a sprite, a text and still have to draw the border (think a button)

the point is I'm making a UI system and I want it to be as slimline as possible and not have to create 100's of sprites and text objects for things like a listbox, combo, I want to just draw them, one code block with minimal function calls but without the abilty to draw an image and then draw some text ontop of the image I'm kinda scraching my head!

any pointers?
nz0
AGK Developer
17
Years of Service
User Offline
Joined: 13th Jun 2007
Location: Cheshire,UK
Posted: 15th Apr 2017 22:07
You can take over the draw sequence by chopping up the sync() process into Update() Render() Swap()
You can draw directly into the back buffer yourself using DrawSprite() and other commands.

I've made UI objects such as what I think you are doing and it's still better to make some functions to work with sprites and such. It's easier to control and read what's interacted with - drawing blindly into the backbuffer means you can't get clicks and mouse-overs etc. as easily.

For instance, you wouldn't need to make 100's of sprites. A box may just need 1 corner and 1 continuous edge piece which you resize and the corners are rotated. Same with buttons. I made some nice gel buttons with a left and right rounded end and a stretchable centre part. You'll need to invest a bit of time, but with UDTs you can make some very tidy looking UI objects which are all reusable and highly flexible.
This would be the sensible way to approach it. The buttons and controls would want to be made in such a way as to be reusable in many ways.

A typical button might have a few or many properties, depending on how ornate your UI is going to be:



I'm not sure if anyone has released a UI suite for AppGameKit, but if not, I bet people would be happy to see one!
For instance, using atlases, you could have an actual button in the image and define the left and right edges as per the example button.
PartTimeCoder
AGK Tool Maker
9
Years of Service
User Offline
Joined: 9th Mar 2015
Location: London UK
Posted: 15th Apr 2017 23:55
thats a pretty good idea, a bit above and beyond what I intended but for a seperate button project I will have a go, not being graphically minded I wanted something I can code and go that all matched each other so a UI framework built with just blocks of color seems prefect to me, albeit a little bland.

the event system was the first thing I wrote, I use the objects x,y,width,height and a homebrew PtInRect function and it works a dream, from button clicks, listbox selection, scrollbar position detection, the lack of sprites here was easily overcome but I'm starting to see many obsticles to my approch, the image and text thing but now I realise that with no sprites I have no alpha values, so it really is plain blocks of bland color

I think there are a couple of UI suites out there but nothing complete or with the functionality I want, like a listbox with a scrollbar and a tree object linked to a xml file, so I guess its back to the drawing board with this one.



nz0
AGK Developer
17
Years of Service
User Offline
Joined: 13th Jun 2007
Location: Cheshire,UK
Posted: 16th Apr 2017 00:25
Maybe something to develop for the community? If there's nothing out there, then there may be a market? I'm not sure of the appetite for kits and plugins for AppGameKit tbh, but I think these kind of things will only strengthen the user base.
DBPro had a lot of community developed extras which lengthened it's life I think. Besides, it's all fun

I'm not graphically capable by any stretch, but buttons and dialogs should be pretty easy. I'd have a go myself actually, but I don't know if there would be enough demand.

I did a really nice replacement for the virtual joystick but never released it, so I don't know.

You'd still want a pretty flexible solution, considering you will probably want to reuse it plus it's more of a mindset thing to get into the habit of using sprites and such because of the flexibility. As long as they are managed properly, you won't "run out" or anything, but benefit from all the designed in functionality.. I mean, you literally have no limits to how whizzy you can make it and therefore how great it could be if you made it re-usable for others.
nz0
AGK Developer
17
Years of Service
User Offline
Joined: 13th Jun 2007
Location: Cheshire,UK
Posted: 16th Apr 2017 00:26
Yea - I mean, what if you want a button in a dialog or dialogs over list boxes etc.. Alpha is pretty much essential too.

Login to post a reply

Server time is: 2024-09-30 01:25:38
Your offset time is: 2024-09-30 01:25:38