Welcome, Guest. Please login or register.

Login with username, password and session length

 
Advanced search

1411425 Posts in 69363 Topics- by 58416 Members - Latest Member: JamesAGreen

April 19, 2024, 08:39:33 AM

Need hosting? Check out Digital Ocean
(more details in this thread)
TIGSource ForumsDeveloperTechnical (Moderator: ThemsAllTook)My first gui prototype
Pages: [1]
Print
Author Topic: My first gui prototype  (Read 884 times)
Artsicle
Guest
« on: July 29, 2017, 09:42:40 AM »

Awhile ago I started this project, and this is it's first prototype.
(Awhile ago as in hours worked on, not the date. I started working on it about a week ago and poured many hours into it.) It may not look visually appealing, but I am planning to work on visual optimizations to make it look better,
also everything will have the power to have images. The border, the background,
the icons (Of course) the buttons, the future button borders, etc
It's made for html5, and I just dont like using libraries that can
probably do better. It's more rewarding to program something yourself imo,
like this library I'm making.
Code:
	function init() {
loop();
guiInstances.mainGui = {
moveable: true,
borderType: "color",
border: "darkblue",
borderSize: 30,
backgroundType: "color",
background: "white",
instanceNumber: 0,
canvas: game.canvas,
context: game.context,
x: 10,
y: 50,
width: 500,
height: 200,
pin: game.images[3],
pinType: "image",
moving: false,
icon: true,
iconType: "image",
title: true,
titleText: "World Announcement!",
titleColor: "white",
content: {
image: ["image", game.images[1], 400, 60, 70, 70], //Type, Image, x, y, width, height
text1: ["text", "black","Arial","italic", "This is a WORLD ANNOUNCEMENT!", 10,20, 20],
text2: ["text", "blue","Courier New","bold", "Hello world!", 50, 50, 20], //Type, Color, Font, Style(Bold,Italics,Etc) Text, X, Y, Size
button1: ["button","color","green","black","Courier New","bold", "Click me",24, 20,100,122,50, function clicked() { alert("Works!"); }] //Type, Type,Button Color/Image, Text Color, Font, Style, Text, TextSize, X, y, width, height, onceClicked on code, (planned) borderType, border
}
};
newGui(guiInstances.mainGui);
}

There's also this, way more basic:
Code:
	function render() {
drawIndividualGui(guiInstances.mainGui);
}
The result:
I just thought I'd post this.
No special reason.
Just proud of it so far.

You can click off now.
I bet nobody actually read all of it.. Droop
Logged
oahda
Level 10
*****



View Profile
« Reply #1 on: August 04, 2017, 01:28:49 AM »

I had a period where I used to do stuff like this all the time, to the point I never actually got any gameplay working, but very advanced GUI's, heh. It can be a lot of fun, tho I know some people feel the exact opposite and dread doing this above everything else.
Logged

Photon
Level 4
****


View Profile
« Reply #2 on: August 04, 2017, 06:21:53 AM »

I'm also very much so a DIY kind of programmer (except for the really low-level stuff,) so I understand this, ha.

What are you planning to use this for?
Logged
Artsicle
Guest
« Reply #3 on: August 04, 2017, 10:40:44 AM »

I'm also very much so a DIY kind of programmer (except for the really low-level stuff,) so I understand this, ha.

What are you planning to use this for?
Im planning on a game with a fake operating system played in browser, and maybe even future games could use this
Logged
Artsicle
Guest
« Reply #4 on: August 05, 2017, 10:25:15 AM »

Had to rewrite it due to an unfixable error
(guiLib3.js now)
I replaced updateInstance with something better (setFlag) since there were problems with positions and the movable property.
Code:
//Examples
setFlag(instance1, "x", "+", 4);
setFlag(instance1, "moveable", "=", false);
setFlag(instance1, "height", "-", 2);
Logged
Pages: [1]
Print
Jump to:  

Theme orange-lt created by panic