@@ -50,6 +50,7 @@ void LooksBlocks::registerBlocks(IEngine *engine)
5050 engine->addCompileFunction (this , " looks_changeeffectby" , &compileChangeEffectBy);
5151 engine->addCompileFunction (this , " looks_seteffectto" , &compileSetEffectTo);
5252 engine->addCompileFunction (this , " looks_cleargraphiceffects" , &compileClearGraphicEffects);
53+ engine->addCompileFunction (this , " looks_changesizeby" , &compileChangeSizeBy);
5354}
5455
5556void LooksBlocks::onInit (IEngine *engine)
@@ -205,6 +206,16 @@ CompilerValue *LooksBlocks::compileClearGraphicEffects(Compiler *compiler)
205206 return nullptr ;
206207}
207208
209+ CompilerValue *LooksBlocks::compileChangeSizeBy (Compiler *compiler)
210+ {
211+ if (compiler->target ()->isStage ())
212+ return nullptr ;
213+
214+ auto change = compiler->addInput (" CHANGE" );
215+ compiler->addTargetFunctionCall (" looks_changesizeby" , Compiler::StaticType::Void, { Compiler::StaticType::Number }, { change });
216+ return nullptr ;
217+ }
218+
208219extern " C" void looks_start_stack_timer (ExecutionContext *ctx, double duration)
209220{
210221 ctx->stackTimer ()->start (duration);
@@ -274,3 +285,8 @@ extern "C" void looks_cleargraphiceffects(Target *target)
274285{
275286 target->clearGraphicsEffects ();
276287}
288+
289+ extern " C" void looks_changesizeby (Sprite *sprite, double change)
290+ {
291+ sprite->setSize (sprite->size () + change);
292+ }
0 commit comments