Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add action to set text object font #6911

Merged
merged 2 commits into from
Sep 2, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Extensions/TextObject/Extension.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ void DeclareTextObjectExtension(gd::PlatformExtension& extension) {
"res/actions/font.png")

.AddParameter("object", _("Object"), "Text")
.AddParameter("police", _("Font"))
.AddParameter("fontResource", _("Font resource name"))
.SetFunctionName("ChangeFont");

obj.AddAction(
Expand Down
5 changes: 3 additions & 2 deletions Extensions/TextObject/JsExtension.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,9 @@ class TextObjectJsExtension : public gd::PlatformExtension {
GetAllExpressionsForObject("TextObject::Text")["FontSize"]
.SetFunctionName("getCharacterSize");

GetAllActionsForObject("TextObject::Text")["TextObject::Font"]
.SetFunctionName("setFontName");

GetAllActionsForObject("TextObject::Text")["TextObject::SetBold"]
.SetFunctionName("setBold");
GetAllConditionsForObject("TextObject::Text")["TextObject::IsBold"]
Expand Down Expand Up @@ -188,8 +191,6 @@ class TextObjectJsExtension : public gd::PlatformExtension {
.SetFunctionName("setShadow");

// Unimplemented actions and conditions:
GetAllActionsForObject("TextObject::Text")["TextObject::Font"]
.SetFunctionName("");
GetAllActionsForObject("TextObject::Text")["TextObject::SetUnderlined"]
.SetFunctionName("");
GetAllConditionsForObject("TextObject::Text")["TextObject::IsUnderlined"]
Expand Down
2 changes: 1 addition & 1 deletion newIDE/app/src/EventsSheet/ParameterRenderingService.js
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ const components = {
atlasResource: AtlasResourceField,
spineResource: SpineResourceField,
color: ColorExpressionField,
police: DefaultField, //TODO
police: DefaultField, // TODO: Remove since fontResource is used now instead.
Copy link
Collaborator

Choose a reason for hiding this comment

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

removed

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Actually, it's a To remove 😅
I'm not sure if I can do it right now. The only doubt I have is if an extension is using a "police" field somehow?

forceMultiplier: ForceMultiplierField,
sceneName: SceneNameField,
layerEffectName: LayerEffectNameField,
Expand Down
Loading