Skip to content

add Iris Text extension - #623

Open
Gen1xLol wants to merge 11 commits into
PenguinMod:mainfrom
Gen1xLol:main
Open

add Iris Text extension#623
Gen1xLol wants to merge 11 commits into
PenguinMod:mainfrom
Gen1xLol:main

Conversation

@Gen1xLol

Copy link
Copy Markdown
Contributor

yeah. this one took me a while

this PR also simultaneously corrects my creator name so that it uses my github

@sakurabuilder

sakurabuilder Bot commented Aug 18, 2026

Copy link
Copy Markdown

✅ Preview ready

Your changes are live at: https://brave-yonder-d2e8daa0.skr.mubilop.com/

Built from 956cb32

@Gen1xLol

Copy link
Copy Markdown
Contributor Author

Also I admit the schedule tag logic is very flimsy and tends to break. I don't understand a lot of the VM, lol. I did what I could

@SharkPool-SP

Copy link
Copy Markdown
Collaborator

Dont take this as a snarky comment, but if you know it tends to break, why should this be merged? People are just gonna report bugs when it does break.

Btw:

  • text border color doesnt change
  • the set character transforms seem to not work?

@Steve0Greatness

Copy link
Copy Markdown
Contributor

Current implementation of reset transformations seems to make it so the flag won't apply tags on several runs of the same code

@Steve0Greatness

Copy link
Copy Markdown
Contributor
image

Changing text color currently seems to tank performance if done too often. People may want to do this for rainbow text effects that shift their color, and alike.

@Steve0Greatness

Steve0Greatness commented Aug 18, 2026

Copy link
Copy Markdown
Contributor

This may be a bit of an ask, but embedding 2 tags inside each other doesn't seem to produce expected results.

image

Note: the expected effects here are that both the hue rotate and text wobble (each character wobbling individually) be applied, such wasn't applied in this case.

@Steve0Greatness

Steve0Greatness commented Aug 18, 2026

Copy link
Copy Markdown
Contributor

Incorrect schedule being used.

image

Hue rotation is being applied when only shake is intended.

It seems to be stuck on the idea that all characters in the current text are hue rotations, despite that not being the case

image

@Gen1xLol

Copy link
Copy Markdown
Contributor Author

Dont take this as a snarky comment, but if you know it tends to break, why should this be merged? People are just gonna report bugs when it does break.

Btw:

  • text border color doesnt change
  • the set character transforms seem to not work?

well... honestly, i was gonna attempt to correct most / all the bugs in this PR
also special thanks to steve for finding a bunch

and also thank you lol

@SharkPool-SP

Copy link
Copy Markdown
Collaborator

If thats the case, this should be a draft

@SharkPool-SP
SharkPool-SP marked this pull request as draft August 18, 2026 06:18
@Gen1xLol

Copy link
Copy Markdown
Contributor Author

Hue rotation is being applied when only shake is intended.

It seems to be stuck on the idea that all characters in the current text are hue rotations, despite that not being the case

oh shit i lowkey forgot that was a feature LMAO
sorry. i really suck at github

@SharkPool-SP

Copy link
Copy Markdown
Collaborator

Hue rotation is being applied when only shake is intended.
It seems to be stuck on the idea that all characters in the current text are hue rotations, despite that not being the case

oh shit i lowkey forgot that was a feature LMAO sorry. i really suck at github

all good

@Gen1xLol

Copy link
Copy Markdown
Contributor Author

Every issue listed here should (hopefully) be resolved. I've done testing on my end and it works

@Gen1xLol

Copy link
Copy Markdown
Contributor Author

I'll turn this back into a regular PR. If more bugs are found I'll make it a draft again.

I've also replaced the "schedule" block with another one that works slightly differently, but is WAY friendlier for the user.

@Gen1xLol
Gen1xLol marked this pull request as ready for review August 18, 2026 20:38
@Gen1xLol

Copy link
Copy Markdown
Contributor Author
block_18_8_2026-07_23_44 here's an example of a test i tried. it should work

@Gen1xLol

Copy link
Copy Markdown
Contributor Author

found some stuff myself. i'll undraft soon

@Gen1xLol
Gen1xLol marked this pull request as draft August 18, 2026 22:52
@Gen1xLol
Gen1xLol marked this pull request as ready for review August 22, 2026 19:22
@Gen1xLol

Copy link
Copy Markdown
Contributor Author

the ext is now ready for review again :D

i added a ton of things. i am aware it's not exactly the most optimized extension ever, but i did what i could. i will update with another PR after this one's merged if i can optimize it more

@SharkPool-SP SharkPool-SP left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These are the only problems i can see rn

];

const customFonts = [];
document.fonts.forEach(face => {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

forEach wont work on browsers like Safari. I encountered this issue with display text,

Use Array.from() and iterate through that

top.strike = true;
break;
case 'size':
top.size = Number(value) || top.size;

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Scratch.Cast.toNumber() ?

textSoFar += text.slice(i, match.index);
stages.push({
text: textSoFar,
waitAfter: Math.max(0, Number(match[1]) || 0)

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Scratch.Cast.toNumber() ?

ctx.drawImage(shape.canvas, padPx, padPx);

entry = {
canvas,

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It will be a smarter and more optimzied idea to use a centeralized canvas for these operations.

Browsers have a max canvas limit apparently.

This also goes for getMaskPatternSurface

}

function drawMaskedGlyph(destCtx, char, fontFamily, size, weight, style, mask, texture, worldDrawX, worldDrawY, spanW, spanH, spanOriginX, spanOriginY, destX, destY, alpha) {
const coverage = Math.max(0, Math.min(100, Number(mask.coverage) || 0)) / 100;

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Scratch.Cast.toNumber()

applyExportSettings(args, util) {
let settings;
try {
settings = JSON.parse(Scratch.Cast.toString(args.SETTINGS));

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should confirm this is an object. Users can pass numbers, objects, arrays, etc. and this will be fine with it


function flushPendingRenders() {
if (!pendingRenderTargets.size) return;
const renderTargets = new Set(pendingRenderTargets);

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why are we making a set of a set?

if (state.shapeKey !== shapeKey || state.layoutKey !== layoutKey || !layout || state.fontsPendingAtMeasure) {
const richChars = parseRichText(state.rawText, state.baseStyle);
applyCharacterStyleOverrides(richChars, state.charStyleOverrides);
const families = new Set(richChars.map(rc => rc.font));

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

surely we can pre-make this set right?

installLinearFiltering(current, state);
}
}
renderer.updateDrawableSkinId(target.drawableID, state.skinId);

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do not run this if the skin already is set for the drawable. Unecessary work

const stage = frame.irisStages[frame.irisStageIndex];
state.rawText = stage.text;
state.paintDirty = true;
scheduleTextRender(util.target);

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if the text is the same we are forcing the renderer to redraw the skin.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants