Page 1 of 1

[Hugor font color thing] Condidential to RealNC, Empire of Greece

Posted: Sun Sep 08, 2019 11:53 am
by Ice Cream Jonsey
So, this is not a request for action, this is just two people talking. We're just talking here!

Hugor has the ability to change the text color, the inputting-of-commands color and the background color. Which is cool, and the interpreter doing that makes sense.

However, you can still have Hugo the programming language do it as well. The game I am entering into the 2019 competition has a routine that lets the player pick the colors between the 15 colors that Hugor supports. It SEEMS that Hugor allows for a full circular palette that you can pick from.

One thing I noticed is that Hugor will override the inputting-of-commands color. So if I issue this command in the .hex file:

color BLACK, BRIGHT_WHITE, BLACK (which is supposed to be black for the foreground (or game text) color, bright white for the background and then black again for the inputting of commands color, then Hugor will override the inputting of commands color, and I think it defaults to bright white.

So that means that in the above case, the input commands color and background will both be white and you can't see what you are typing in.

There's a dozen ways this could all go and this close to the comp I wouldn't want any changes to Hugor but maybe I should just direct people to use Hugor to change the colors? I dunno.

We're just talking here!!

Re: [Hugor font color thing] Condidential to RealNC, Empire of Greece

Posted: Sun Sep 08, 2019 11:53 am
by Ice Cream Jonsey
Also, a video would probably be a million times easier for me to communicate all this.

Re: [Hugor font color thing] Condidential to RealNC, Empire of Greece

Posted: Mon Sep 09, 2019 10:41 am
by RealNC
Is this happening with the latest Hugor version? (2.2) I can't reproduce the bug with:

Code: Select all

#include "hugolib.h"

routine Main
{
    color BLACK, BRIGHT_WHITE, BLACK
}
This produces the correct result for me, black input text on white input background on window background. And this:

Code: Select all

#include "hugolib.h"

routine Main
{
    color BLACK, DEF_BACKGROUND, BLACK
}
produces black input text with the input background matching whatever the window background currently is.

Re: [Hugor font color thing] Condidential to RealNC, Empire of Greece

Posted: Wed Oct 09, 2019 9:29 pm
by RealNC
Any update on this?

Re: [Hugor font color thing] Condidential to RealNC, Empire of Greece

Posted: Thu Oct 10, 2019 5:56 am
by Ice Cream Jonsey
You know what, since you didn't see it I was going to let it go - I'll try to create a small test file for this and do what you say today.

Re: [Hugor font color thing] Condidential to RealNC, Empire of Greece

Posted: Tue Mar 31, 2020 1:02 am
by Roody_Yogurt
I was just playing around with this in Hugor version 2.2.0 and I think I need some clarification from Nikos. I'm trying to change colors using the opcode system. So if I wanted to change RED to green, I would writeval RED (4) then writeval 0, writeval 255, writeval 0, and finally writeval 255 for the alpha value.

I'm trying this but all I'm getting is actual red. What am I doing wrong?

Re: [Hugor font color thing] Condidential to RealNC, Empire of Greece

Posted: Tue Mar 31, 2020 4:06 am
by RealNC
Roody_Yogurt wrote: Tue Mar 31, 2020 1:02 am So if I wanted to change RED to green, I would writeval RED (4) then writeval 0, writeval 255, writeval 0, and finally writeval 255 for the alpha value.
You can only set colors 100 to 254. I'm not sure what the use case would be of having RED mean GREEN :P

Re: [Hugor font color thing] Condidential to RealNC, Empire of Greece

Posted: Tue Mar 31, 2020 4:13 am
by RealNC
I changed the description of the opcode in the online spreadsheet to reflect this.

Re: [Hugor font color thing] Condidential to RealNC, Empire of Greece

Posted: Tue Mar 31, 2020 6:34 am
by Roody_Yogurt
I think you've explained this to me in the past (although I couldn't remember where so I couldn't look it up), but in my mind's eye, the new colors were still restricted to the original 16 slots, so you might choose one color combination that would look okay under the old restrictions but could re-program those colors so they looked even better in Hugor (I only chose GREEN because I was too lazy to look up actually interesting colors; I was just testing functionality).

Having all of these additional slots for colors is great, though. Games can just check for the availability of the opcode trick and set their colors accordingly.

Re: [Hugor font color thing] Condidential to RealNC, Empire of Greece

Posted: Tue Mar 31, 2020 8:07 am
by RealNC
Roody_Yogurt wrote: Tue Mar 31, 2020 6:34 amthe new colors were still restricted to the original 16 slots
I'm not sure I understand what you mean.

Re: [Hugor font color thing] Condidential to RealNC, Empire of Greece

Posted: Tue Mar 31, 2020 8:15 am
by Roody_Yogurt

Code: Select all

enumerate                               ! colors 0 to 17
{
	BLACK, BLUE, GREEN, CYAN, RED, MAGENTA, BROWN, WHITE,
	DARK_GRAY, LIGHT_BLUE, LIGHT_GREEN, LIGHT_CYAN,
	LIGHT_RED, LIGHT_MAGENTA, YELLOW, BRIGHT_WHITE,
	DEF_FOREGROUND, DEF_BACKGROUND,
	DEF_SL_FOREGROUND, DEF_SL_BACKGROUND,
	MATCH_FOREGROUND
}
Basically, I assumed we were limited to the values between BLACK and BRIGHT_WHITE, redefining what color would be shown in color-opcode-capable interpreters.

Re: [Hugor font color thing] Condidential to RealNC, Empire of Greece

Posted: Tue Mar 31, 2020 10:35 am
by RealNC
Yeah, that's not the case. The Hugo compiler's "color" instruction accepts any value, so this works:

color 100, 101
print "Hey"

You can set colors 100 and 101 to anything you want using the opcode.