Blending mode, Steam project

This commit is contained in:
Tanasart 2023-02-16 08:51:51 +07:00
parent b244b81fdb
commit 26d4f33132
8 changed files with 28 additions and 18 deletions

View file

@ -1183,14 +1183,9 @@
{"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"workshop_bg.png","CopyToMask":-1,"filePath":"datafiles/data/themes/default/graphics/UI",},
{"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"workshop_frame.png","CopyToMask":-1,"filePath":"datafiles/data/themes/default/graphics/UI",},
{"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"0 introduction.png","CopyToMask":-1,"filePath":"datafiles/Getting started",},
{"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"1 image import.pxc","CopyToMask":-1,"filePath":"datafiles/Getting started",},
{"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"2 animation.png","CopyToMask":-1,"filePath":"datafiles/Getting started",},
{"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"3 Group and collection.png","CopyToMask":-1,"filePath":"datafiles/Getting started",},
{"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"2 animation.pxc","CopyToMask":-1,"filePath":"datafiles/Getting started",},
{"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"3 Group and collection.pxc","CopyToMask":-1,"filePath":"datafiles/Getting started",},
{"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"0 introduction.pxc","CopyToMask":-1,"filePath":"datafiles/Getting started",},
{"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"1 image import.png","CopyToMask":-1,"filePath":"datafiles/Getting started",},
{"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"5 Particle and effectors.pxc","CopyToMask":-1,"filePath":"datafiles/Getting started",},
{"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"arrowRight.png","CopyToMask":-1,"filePath":"datafiles/Getting started",},
{"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"card_back.png","CopyToMask":-1,"filePath":"datafiles/Getting started",},
{"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"card_clubs_02.png","CopyToMask":-1,"filePath":"datafiles/Getting started",},
@ -1207,20 +1202,15 @@
{"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"multi file dialog.png","CopyToMask":-1,"filePath":"datafiles/Getting started",},
{"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"5 Particle and effectors.png","CopyToMask":-1,"filePath":"datafiles/Getting started",},
{"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"tile_0044.png","CopyToMask":-1,"filePath":"datafiles/Getting started",},
{"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"4 Looping operation.pxc","CopyToMask":-1,"filePath":"datafiles/Getting started",},
{"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"tile_0067.png","CopyToMask":-1,"filePath":"datafiles/Getting started",},
{"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"tile_0126.png","CopyToMask":-1,"filePath":"datafiles/Getting started",},
{"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"LICENSE.txt","CopyToMask":-1,"filePath":"datafiles/ImageMagick",},
{"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"convert.exe","CopyToMask":-1,"filePath":"datafiles/ImageMagick",},
{"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"Bevel.png","CopyToMask":-1,"filePath":"datafiles/Sample Projects",},
{"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"Broken heart.png","CopyToMask":-1,"filePath":"datafiles/Sample Projects",},
{"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"Broken heart.pxc","CopyToMask":-1,"filePath":"datafiles/Sample Projects",},
{"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"Cards flipping.png","CopyToMask":-1,"filePath":"datafiles/Sample Projects",},
{"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"Cards flipping.pxc","CopyToMask":-1,"filePath":"datafiles/Sample Projects",},
{"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"Dice.png","CopyToMask":-1,"filePath":"datafiles/Sample Projects",},
{"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"Dice.pxc","CopyToMask":-1,"filePath":"datafiles/Sample Projects",},
{"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"Shiny gem.png","CopyToMask":-1,"filePath":"datafiles/Sample Projects",},
{"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"Shiny gem.pxc","CopyToMask":-1,"filePath":"datafiles/Sample Projects",},
{"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"Tree sway.png","CopyToMask":-1,"filePath":"datafiles/Sample Projects",},
{"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"Tree sway.pxc","CopyToMask":-1,"filePath":"datafiles/Sample Projects",},
{"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"arrowRight.png","CopyToMask":-1,"filePath":"datafiles/Sample Projects",},
@ -1437,7 +1427,6 @@
{"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"graphics x2.ai","CopyToMask":-1,"filePath":"datafiles/data/themes/default/graphics/inspector",},
{"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"s_inspector_surface_halign.png","CopyToMask":-1,"filePath":"datafiles/data/themes/default/graphics/inspector",},
{"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"s_inspector_surface_valign.png","CopyToMask":-1,"filePath":"datafiles/data/themes/default/graphics/inspector",},
{"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"Collections.zip","CopyToMask":-1,"filePath":"datafiles/data",},
{"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"Assets.zip","CopyToMask":-1,"filePath":"datafiles/data",},
{"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"graphic.ai","CopyToMask":-1,"filePath":"datafiles/data/themes/default/graphics/UI",},
{"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"workshop_badge.png","CopyToMask":-1,"filePath":"datafiles/data/themes/default/graphics/UI",},
@ -1447,6 +1436,17 @@
{"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"s_noti_icon_file_save.png","CopyToMask":-1,"filePath":"datafiles/data/themes/default/graphics/icon",},
{"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"default.zip","CopyToMask":-1,"filePath":"datafiles/data/themes",},
{"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"magick.exe","CopyToMask":-1,"filePath":"datafiles/ImageMagick",},
{"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"Collections.zip","CopyToMask":-1,"filePath":"datafiles/data",},
{"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"0 introduction.pxc","CopyToMask":-1,"filePath":"datafiles/Getting started",},
{"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"1 image import.pxc","CopyToMask":-1,"filePath":"datafiles/Getting started",},
{"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"2 animation.pxc","CopyToMask":-1,"filePath":"datafiles/Getting started",},
{"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"3 Group and collection.pxc","CopyToMask":-1,"filePath":"datafiles/Getting started",},
{"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"4 Looping operation.pxc","CopyToMask":-1,"filePath":"datafiles/Getting started",},
{"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"5 Particle and effectors.pxc","CopyToMask":-1,"filePath":"datafiles/Getting started",},
{"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"Broken heart.pxc","CopyToMask":-1,"filePath":"datafiles/Sample Projects",},
{"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"Cards flipping.pxc","CopyToMask":-1,"filePath":"datafiles/Sample Projects",},
{"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"Dice.pxc","CopyToMask":-1,"filePath":"datafiles/Sample Projects",},
{"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"Shiny gem.pxc","CopyToMask":-1,"filePath":"datafiles/Sample Projects",},
],
"MetaData": {
"IDEVersion": "2022.11.1.56",

View file

@ -7,7 +7,9 @@ event_inherited();
dialog_w = ui(960);
dialog_h = ui(600);
pages = ["Sample projects", "Steam Workshop"];
pages = ["Sample projects"];
if(STEAM_ENABLED)
array_push(pages, "Steam Workshop");
project_page = 0;
#endregion

View file

@ -1,5 +1,5 @@
globalvar BLEND_TYPES;
BLEND_TYPES = [ "Normal", "Add", "Subtract", "Subtract keep alpha", "Multiply", "Multiply keep Alpha", "Screen", "Screen keep Alpha", "Contrast", "Overlay", "Maximum", "Minimum" ];
BLEND_TYPES = [ "Normal", "Add", "Subtract", "Multiply", "Screen", "Contrast", "Overlay", "Hue", "Saturation", "Luminosity", "Maximum", "Minimum" ];
enum BLEND_MODE {
normal,
@ -60,7 +60,7 @@ function draw_surface_blend(background, foreground, blend, alpha, _pre_alp = tru
shader_set_uniform_i(uniform_tile, tile);
}
BLEND_OVERRIDE
BLEND_OVER_ALPHA
draw_surface_stretched_safe(background, 0, 0, surf_w, surf_h);
BLEND_NORMAL
shader_reset();

View file

@ -128,8 +128,8 @@ function Node_Blend(_x, _y, _group = -1) : Node_Processor(_x, _y, _group) constr
hh = surface_get_height(_mask);
break;
case 3 :
ww = max(surface_get_width(_back), surface_get_width(_foreDraw), surface_get_width(_mask));
hh = max(surface_get_height(_back), surface_get_height(_foreDraw), surface_get_height(_mask));
ww = max(surface_get_width(_back), surface_get_width(_fore), surface_get_width(_mask));
hh = max(surface_get_height(_back), surface_get_height(_fore), surface_get_height(_mask));
break;
case 4 :
ww = _out_dim[0];

View file

@ -126,10 +126,14 @@ function Panel_Menu() : PanelContent() constructor {
[ get_text("panel_menu_steam", "Steam page"), function() {
url_open("https://store.steampowered.com/app/2299510/Pixel_Composer");
} ],
-1,
-1,
[ get_text("panel_menu_directory", "Open local directory"), function() {
shellOpenExplorer(DIRECTORY);
} ],
[ get_text("panel_menu_reset_default", "Reset default collection, assets"), function() {
zip_unzip("data/Collections.zip", DIRECTORY + "Collections");
zip_unzip("data/Assets.zip", DIRECTORY + "Assets");
} ],
]],
]

View file

@ -21,4 +21,8 @@ function point_rectangle_overlap(w, h, angle) {
}
return [x0, y0];
}
function point_in_rectangle_points(px, py, x0, y0, x1, y1, x2, y2, x3, y3) {
return point_in_triangle(px, py, x0, y0, x1, y1, x2, y2) || point_in_triangle(px, py, x1, y1, x2, y2, x3, y3);
}

View file

@ -4,6 +4,7 @@ function __initSteamUGC() {
STEAM_COLLECTION = ds_list_create();
STEAM_PROJECTS = ds_list_create();
if(DEMO) return;
if(!STEAM_ENABLED) return;
steam_ugc_get_subscribed_items(STEAM_SUBS);

View file

@ -35,7 +35,6 @@ void main() {
float al = _col0.a + _col1.a * (1. - _col0.a);
vec4 res = ((_col0 * _col0.a) + (_col1 * _col1.a * (1. - _col0.a))) / al;
res.a = al;
if(preserveAlpha == 1) res.a = _col1.a;
gl_FragColor = res;
}