((SG)) StyleSheet - Extract and set modified CSS code from the game interface.

StyleSheet 2.25


With StyleSheet it is possible to extract the modified CSS code from the HTML code of the game (accessible via the HTML tools) and then integrate it into the source code or export it as a CSS file.


Extract the files directly into the game directory and integrate the StyleSheet.aslx as a library into the game.


Preview StyleSheet


To download the library simply right-click here and select "Save as..."!


You want to see all libraries of SoonGames? Just click here!


Have fun with the library!

enter image description here


The following updates are in version 2.0:

  • The name has been changed to' Stylesheet'.
  • Only the changes are extracted.
  • Extraction by pressing CTRL + ENTER.
  • Automatic setting of the interface language.

The following updates are in version 2.1:

  • Bug fixing of parallel functions.

I missed this one somehow!

This is VERY nice!


Thank you very much.


However, it still needs to be put through its paces. It could be that there are a few more screws to turn.


The concept is genius.

(Plus, you've added a function that responds to CTRL+Enter! How'd you do that? I've been trying to tap into the command key functionality in order to add a RESTART command for the desktop player.)


I used a javascript function (JQuery):

$(document).keydown(function(e) {
    if (e.ctrlKey && e.keyCode === 13) {
        (...)
    }
});

The following updates are in version 2.11:

  • Add important information.

The following updates are in version 2.12:

  • Add box as a selection for already created code.

The following updates are in version 2.20:

  • The classes are now included in the change. Unnecessary extraction options have been removed.

The following updates are in version 2.21:

  • Using the user interface no longer has any influence on extracting.

The following updates are in version 2.22:

  • ATTENTION: Important update! Fix bug when publishing the game!
    Both files (StyleSheet.aslx and StyleSheet.js) are now in the game directory.
    The StyleSheet_lib folder is no longer required.

Hey!
I started working with this lib last night and it's really something!
I like it a whole lot!
However, I have a problem that makes it demanding to work with.

The ctrl+enter press only works every now and then.
Several times I've designed a UI I like to have for the next act of my game but when I press CTRL + Enter.... nothing happens.

I've tried and tried and to be me it sees that it has a 100% success rate the first time... but after that it won't work, most of the times.

Is this just me?

EDIT:
After further trying to come to terms with it I think I know what seems to be wrong).
It seems it won't get the new code after altering an element already altered.

Example.

.ui-widget-content {
    border: 3px solid rgb(0, 0, 0);
    background: rgb(85, 86, 92);
}

I changed this (above), got the code, entered it and launched the game.
It looked the way I wanted it to except for the font colour of the text content.
I changed it but wouldn't get the code. I tried this several times.
Then I went into to CSS in the actual game and just added color: rgb(255, 255, 255);

.ui-widget-content {
    border: 3px solid rgb(0, 0, 0);
    background: rgb(85, 86, 92);
    color: rgb(255, 255, 255);
}

... and it's working nicely!

The thing is. Although it's super easy to add that line myself I'm afraid my CSS knowledge is severely limited and when it comes to more complicated things than changing the colour of a text element I'm pretty sure I won't be handle it.

Hence: it would be cool if I could get the code every time, even though it's for an element I've already played around with.

Just my two cents! :)


Thanks for your feedback. I tested it on myself and it went quite well.

For CTRL + Enter to work, the focus must be on the playing field. It is best to execute the shortcut after the HTML tools have been closed.

If you want to add CSS code to an already made change I recommend to activate the checkbox "Copy the already created CSS code to the clipboard".



If you have any further questions, please do not hesitate to contact me.

Many greetings

Sven
SoonGames

Translated with www.DeepL.com/Translator


The following updates are in Version 2.25:

  • Two bugs were fixed that prevented some CSS selectors from caching.
  • Source code optimization.

This topic is now closed. Topics are closed after 60 days of inactivity.

Support

Forums