Lua libcurl

  • #20, z darren-beckettMonday, 20. March 2017, 17:30 hodinky 8 years ago
    heh! only problem with that is, if Simon stops to work on creating ved examples & documentation for everything then while he's doing that no work would be done on the engine itself. - more a case of needing additional developers to lighten/spread the workload around.
    I'm 100% sure that Simon doesn't release code without running at least a couple of tests :-)

    My suggestion would be to have a standard VED that any new code can be dropped into, we would then have a tested and runnable example of the new feature.

    We appreciate Simon taking the time to post on the forum, but 5 minutes of his time to produce the example ved, would mean less time replying to us on to the forum.

    Čestný člen

    384 Posts


  • #21, z afrlmeMonday, 20. March 2017, 18:23 hodinky 8 years ago
    heh! only problem with that is, if Simon stops to work on creating ved examples & documentation for everything then while he's doing that no work would be done on the engine itself. - more a case of needing additional developers to lighten/spread the workload around.
    I'm 100% sure that Simon doesn't release code without running at least a couple of tests :-)

    My suggestion would be to have a standard VED that any new code can be dropped into, we would then have a tested and runnable example of the new feature.

    We appreciate Simon taking the time to post on the forum, but 5 minutes of his time to produce the example ved, would mean less time replying to us on to the forum.

    It's never 5 minutes; though I'm aware you are just giving that number as an example. The advanced menu template I created a couple years back took me at least 3 days. Each wiki page I have typed up as taken me minimum 20 minutes & that's for the pages with hardly any content on them. The ones I created with both tutorial & an example ved probably took better part of an afternoon each - it's not simply creating, but checking over what you've written, fixing it & the same goes for documentation as it often takes multiple reads to check for typos & see if it's possible to trim out content filler or edit phrases to make them easier to understand by the most amount of people possible.

    It takes me far less time to reply to a post on the forum - even replying to threads containing questions that have previously been asked in existing threads before - than it does to work on a documentation page in the wiki or create a tutorial. For one I don't have to plan anything out or prep any materials/assets I need.

    Imperátor

    7285 Posts

  • #22, z darren-beckettMonday, 20. March 2017, 22:00 hodinky 8 years ago
    Doing a proper job as you have explained will certainly take time and is certainly required for any newbies or those without a background in development.

    I was just suggesting that the Dev testing could be the starting point. A working example wouldn't need much additional documentation, especially if it's well commented.

    Čestný člen

    384 Posts

  • #23, z darren-beckettWednesday, 22. March 2017, 10:15 hodinky 8 years ago
    Simon, are you there?

    I can't get the sprite to display:
    -- Download image to memory 
    
    downloadMemory(imageUrl, function(s, param) 
    
     local pos = string.find(string.reverse(imageUrl), "%.")	-- Find Last fullstop 
    
     local imageType = string.upper(string.sub(imageUrl, string.len(imageUrl) - pos +2)) 
    
    
    
     print("ImageType: ", imageType) 
    
     if imageType == "JPG" then 
    
        sprite = graphics.loadMemoryJPG(s) 
    
     elseif imageType == "PNG" then 
    
        sprite = graphics.loadMemoryPNG(s) 
    
     elseif imageType == "WEBP" then 
    
        sprite = graphics.loadMemoryWEBP(s) 
    
     end 
    
    
    
     if sprite == nil then 
    
        print("Sprite is null") 
    
     end 
    
     --sprite.position = {x = 300, y = 300} 
    
     graphics.drawSprite(sprite) 
    
     print("Image should be shown") 
    
    end)

    No errors, Sprite is not null

    Ideally, i would like to assign the new sprite to an existing scene object

    Čestný člen

    384 Posts

  • #24, z darren-beckettMonday, 27. March 2017, 10:08 hodinky 8 years ago
    Can anybody help with this?

    Čestný člen

    384 Posts

  • #25, z SimonSMonday, 27. March 2017, 14:01 hodinky 8 years ago
    The sprite needs to be drawn every frame via the draw callback.

    Kapitán

    1582 Posts

  • #26, z darren-beckettMonday, 27. March 2017, 14:08 hodinky 8 years ago
    Ok, How is this done?

    Čestný člen

    384 Posts

  • #27, z darren-beckettTuesday, 28. March 2017, 12:02 hodinky 8 years ago
    Help?

    Čestný člen

    384 Posts

  • #28, z SimonSTuesday, 28. March 2017, 12:13 hodinky 8 years ago
    You already used the code: (by the way, the function name will change to addDrawFunc in Vis 5)

    function draw()
      if sprite ~= nil then
        graphics.drawSprite(sprite)
      end
    end
    <span>
    graphics.setDrawFunc("draw()")</span>
    

    Kapitán

    1582 Posts

  • #29, z darren-beckettTuesday, 28. March 2017, 16:39 hodinky 8 years ago
    Thanks.
    I now have something being shown (It's flickering), but at least something has happened.

    Is it possible to set this sprite to an existing scene object? 
    or set an action to occur when the sprite is clicked?

    Čestný člen

    384 Posts

  • #30, z SimonSTuesday, 28. March 2017, 17:28 hodinky 8 years ago
    No, you need to change the position yourself:

    sprite.position = {x=0,y=0}

    Also you need to listen yourself for events. Easiest way would be putting an object border there.

    Kapitán

    1582 Posts