Hello, I have a issue with setting the bounds position with cabbageSet (in the if-statement).
Am I doing something wrong?
<Cabbage>
form caption("Untitled") size(400, 300), guiMode("queue") pluginId("def1")
;;;;;;;;;;;;;;;;;;;;;
;Graphical envelope
;;;;;;;;;;;;;;;;;;;;;
;Background
image bounds(1, 1, 160, 120) channel("Background")
;Points
image bounds(118, 80, 19, 23) channel("PointOne") colour(255, 0, 0, 255)
</Cabbage>
<CsoundSynthesizer>
<CsOptions>
-n -d -+rtmidi=NULL -M0 -m0d
</CsOptions>
<CsInstruments>
; Initialize the global variables.
ksmps = 32
nchnls = 2
0dbfs = 1
instr 1
;Mouse position and clicks
kPosX cabbageGet "MOUSE_X"
kPosY cabbageGet "MOUSE_Y"
kMouseDown cabbageGet "MOUSE_DOWN_LEFT"
;Background position and size
iBounds[] cabbageGet "Background", "bounds"
iBoundsPosX = iBounds[0]
iBoundsPosY = iBounds[1]
iBoundsSizeX = iBounds[2]
iBoundsSizeY = iBounds[3]
if kMouseDown == 1 then
cabbageSet "PointOne", "bounds", kPosX, kPosY, 10, 10
endif
endin
</CsInstruments>
<CsScore>
i1 0 [60*60*24*7]
</CsScore>
</CsoundSynthesizer>