StoryTool Development

I am back at trying to make graphics inside Renoise and to continue learning LUA coding.
I recently undestood that if I use PNG images instead of BMP images I get perfect opacity.
roboprogress
Next I want to learn; how to make animation that match the beat; how to change picture when clicking on it; how to change pictures through keyboard.
I have no idea how, but i will look into how nibbles game is coded and, once again read through all the LUA learning material.

3 Likes

Changing a image is very simple. Here an example:

--local
local vb=renoise.ViewBuilder()
local vws=vb.views
local LOOP_BITMAP=1

--bitmap patch table
local png_patch_table={
  "Bitmaps/rooppoo_01.png",
  "Bitmaps/rooppoo_02.png",
  "Bitmaps/rooppoo_03.png",
  "Bitmaps/rooppoo_04.png",
}

--change bitmap images function
local function change_bitmap_image(idx)
  vws.MY_BITMAP_01.bitmap=png_patch_table[idx]
end

--loop bitmap images function
local function change_bitmap_image_loop()
  if (LOOP_BITMAP==1) then
    vws.MY_BITMAP_01.bitmap=png_patch_table[2]
    vws.MY_BITMAP_01.tooltip="My Bitmap 02"
    LOOP_BITMAP=2
  elseif(LOOP_BITMAP==2) then
    vws.MY_BITMAP_01.bitmap=png_patch_table[3]
    vws.MY_BITMAP_01.tooltip="My Bitmap 03"
    LOOP_BITMAP=3
  elseif(LOOP_BITMAP==3) then
    vws.MY_BITMAP_01.bitmap=png_patch_table[4]
    vws.MY_BITMAP_01.tooltip="My Bitmap 04"
    LOOP_BITMAP=4
  else
    vws.MY_BITMAP_01.bitmap=png_patch_table[1]
    vws.MY_BITMAP_01.tooltip="My Bitmap 01"
    LOOP_BITMAP=1
  end
end

--inside your viewbuilder
vb.bitmap{
  id="MY_BITMAP_01", --see it!!!
  --active=true,
  --visible=true,
  height=209,
  width=209,
  mode="transparent",
  bitmap="Bitmaps/rooppoo_01.png",
  notifier=function() function change_bitmap_image(3) end, --change to "Bitmaps/rooppoo_03.png",
  --notifier=function() change_bitmap_image_loop() end, --or use this function to loop
  tooltip="My Bitmap 01"
}

I have written the code directly here. But it should work. Make sure the images exist, with the correct names.

Forget about the outside stuff and study how the existing API documentation works.

1 Like

thanx !!! looking closer

:+1: