Advertisement
Noneatme

Untitled

Aug 14th, 2013
173
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.67 KB | None | 0 0
  1. -- #######################################
  2. -- ## Project: Pointer Resource         ##
  3. -- ## Name: Blender.lua                 ##
  4. -- ## Author: Noneatme                  ##
  5. -- ## Version: 1.0                      ##
  6. -- ## License: See top Folder           ##
  7. -- #######################################
  8.  
  9. -- FUNCTIONS / METHODS --
  10.  
  11. local cFunc = {};       -- Local Functions
  12. local cSetting = {};    -- Local Settings
  13.  
  14. Blender = {};
  15. Blender.__index = Blender;
  16.  
  17. --[[
  18.  
  19. ]]
  20.  
  21. -- ///////////////////////////////
  22. -- ///// New                //////
  23. -- ///// Returns: Object    //////
  24. -- ///////////////////////////////
  25.  
  26. function Blender:New(...)
  27.     local obj = setmetatable({}, {__index = self});
  28.     if obj.Constructor then
  29.         obj:Constructor(...);
  30.     end
  31.     return obj;
  32. end
  33.  
  34. -- ///////////////////////////////
  35. -- ///// GetBlendingValue   //////
  36. -- ///// Returns: void      //////
  37. -- ///////////////////////////////
  38.  
  39. function Blender:GetBlendingValue(von, bis, time, blendingValue)
  40.     if not(self.startTick) then
  41.         self.startTick = getTickCount()
  42.     end
  43.     local a;
  44.    
  45.     local a1 = interpolateBetween(von, 0, 0, bis, 0, 0, ((getTickCount()-self.startTick)/blendingValue), "InQuad")
  46.     a = a1
  47.    
  48.     if(a1 >= bis) and (getTickCount()-self.startTick > time/2) then
  49.         if not(self.endTick) then
  50.             self.endTick = getTickCount()
  51.         end
  52.         a2 = interpolateBetween(a1, 0, 0, 0, 0, 0, ((getTickCount()-self.endTick)/blendingValue), "OutQuad")
  53.         a = a2
  54.     end
  55.  
  56.     return a
  57. end
  58.  
  59. -- ///////////////////////////////
  60. -- ///// Constructor        //////
  61. -- ///// Returns: void      //////
  62. -- ///////////////////////////////
  63.  
  64. function Blender:Constructor(...)
  65.     -- Instances --
  66.     self.startTick = false;
  67.    
  68.     outputDebugString("[CALLING] Blender: Constructor");
  69. end
  70.  
  71. -- EVENT HANDLER --
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement