Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Codea 2.6.3 (132 & 133)

2»

Comments

  • edited January 2019 Posts: 1,703

    @dave1707 @Simeon - just loaded 137 and ran this, camera image not full image, tried changing spriteMode() to center no change. Does seem to give correct aspect but only part of image.

  • edited January 2019 Posts: 1,703

    @Simeon - piccies attached showing the problem with comment lines.

  • JohnJohn Admin Mod
    Posts: 615

    @Bri_G @dave13259 It takes at least one frame for the camera to initialise I think.

  • dave1707dave1707 Mod
    edited January 2019 Posts: 8,382

    @Simeon @John I haven’t played around with the camera for awhile, but when I run the code below sometimes the image is too dark to see it. If I tap the screen to try again it’s OK. @John I put in a delay to go thru a few draw cycles but the image is still dark.

    function setup()
        displayMode(FULLSCREEN)  
        cnt=0  
    end
    
    function draw()
        background(0)
        fill(255)
        text("tap screen for camera",WIDTH/2,HEIGHT-50)
        if img~=nil then
            sprite(img,WIDTH/2,HEIGHT/2)
        elseif cnt>5 then
            img=image(CAMERA)
        end
        cnt=cnt+1
    end
    
    function touched(t)
        if t.state==BEGAN then
            img=image(CAMERA)
        end
    end
    
    
  • @Simeon in something i’m doing i see different behaviour starting from scratch (first start after launching the project) than when restarting after an exit. Should that be possible? (this was present in previous versions of codea).

  • SimeonSimeon Admin Mod
    Posts: 5,360

    @Bri_G oh I don't think they're transparent. The default fill colour is 200, 200, 200. A light grey. That grey is multiplying with the texture colours because the vertex colours default to the current fill. So this is not a bug, just a bit unintuitive though.

  • SimeonSimeon Admin Mod
    Posts: 5,360

    @piinthesky what's the behaviour change? If it happens then it seems like a bug to me and I'd like to investigate.

  • SimeonSimeon Admin Mod
    Posts: 5,360

    @Bri_G did that problem with the comments go away after a bit or stick around?

  • @Simeon it’s a 3D model that will display from first start but then will not display after restart. Weird, as i use many models and the others all display correctly! Its quite difficult to give you the program as you need to have all the models. I’ll investigate more and see if i can find a way to make it work.

  • Posts: 1,703

    @Simeon - it disappears as I edit the code. Messy code at the moment as I try to figure out ways to get what I need. I have a problem andI’m not sure if it’sa Bug or just my bad programming.

  • Posts: 1,703

    @Simeon - could be that I had something like this:


    -- CommentError -- Use this function to perform your initial setup function setup() -- test = "Testing" test2 = "checking" --[[ for x = 1,5 do print(test,300,300) end --[[ a = 76 --]] for y = 1,5 do print(test2,300,300) end --]] end function draw() -- This sets a dark background color background(40, 40, 50) end

    Not really a bug just a little puzzling if some of the code is off screen.

  • dave1707dave1707 Mod
    edited January 2019 Posts: 8,382

    @Bri_G You have a block comment within a block comment. What happening in the code is the second —[[ is being commented out within the first —[[ and first —]] . The second —]] is being ignored and the second for loop is executing. It may or may not be a bug depending on how you want to interpret it.

    PS. I think both for loops should be commented out. Like you said if the code is off the screen it can be a problem figuring out what’s wrong.

  • edited January 2019 Posts: 1,703

    @dave1707 - thanks for the feedback, that’s not the code I was using but it is the only way that I have found to create the effect. It could be what I had done, usually I go over the code and tidy up any nestings - but should this effect happen. May confuse some coders.

  • dave1707dave1707 Mod
    Posts: 8,382

    @Bri_G I understand that’s just example code and I think I’ve run into that problem a few times also. As I mentioned in my PS above, I think both for loops should have been commented out.

Sign In or Register to comment.