diff --git a/stepmania/src/ActorScroller.cpp b/stepmania/src/ActorScroller.cpp index 9aef4b873d..5feae8c17e 100644 --- a/stepmania/src/ActorScroller.cpp +++ b/stepmania/src/ActorScroller.cpp @@ -70,6 +70,11 @@ void ActorScroller::SetTransformFromExpression( const RString &sTransformFunctio SetTransformFromReference( ref ); } +void ActorScroller::SetTransformFromWidth( float fItemWidth ) +{ + SetTransformFromExpression( ssprintf("function(self,offset,itemIndex,numItems) self:x(%f*offset) end",fItemWidth) ); +} + void ActorScroller::SetTransformFromHeight( float fItemHeight ) { SetTransformFromExpression( ssprintf("function(self,offset,itemIndex,numItems) self:y(%f*offset) end",fItemHeight) ); @@ -309,6 +314,7 @@ public: return 0; } static int SetTransformFromHeight( T* p, lua_State *L ) { p->SetTransformFromHeight(FArg(1)); return 0; } + static int SetTransformFromWidth( T* p, lua_State *L ) { p->SetTransformFromWidth(FArg(1)); return 0; } static int SetCurrentAndDestinationItem( T* p, lua_State *L ) { p->SetCurrentAndDestinationItem( FArg(1) ); return 0; } static int SetDestinationItem( T* p, lua_State *L ) { p->SetDestinationItem( FArg(1) ); return 0; } static int getsecondtodestination( T* p, lua_State *L ) { lua_pushnumber( L, p->GetSecondsToDestination() ); return 1; } @@ -327,6 +333,7 @@ public: ADD_METHOD( PositionItems ); ADD_METHOD( SetTransformFromFunction ); ADD_METHOD( SetTransformFromHeight ); + ADD_METHOD( SetTransformFromWidth ); ADD_METHOD( SetCurrentAndDestinationItem ); ADD_METHOD( SetDestinationItem ); ADD_METHOD( getsecondtodestination ); diff --git a/stepmania/src/ActorScroller.h b/stepmania/src/ActorScroller.h index aff47f9846..04c33f3ee8 100644 --- a/stepmania/src/ActorScroller.h +++ b/stepmania/src/ActorScroller.h @@ -15,6 +15,7 @@ public: void SetTransformFromReference( const LuaReference &ref ); void SetTransformFromExpression( const RString &sTransformFunction ); + void SetTransformFromWidth( float fItemWidth ); void SetTransformFromHeight( float fItemHeight ); void Load2();