Quick Links: Gideros Home | Download Gideros | Developer Guide
E-book template - Gideros Forums
E-book template
  • gorkemgorkem +1 -1 (+6 / -0 )
    Hi guys

    Here's a nice e-book template. Feel free to study, examine, copy and use it in your projects.

    Best
    Gorkem
    Gideros_Ebook_Template.zip
    6M
    Before starting with Gideros Studio, read our extensive Developer FAQ here
  • Thank you! :-bd
    Don't forget to have fun :)
  • Very nice :) - thank you.
  • Is there way to change pages using finger moves?
  • it's kind different thing. I'm just trying to understand how to add event on a gesture. Something like set x=0 when mousedown, then track mousemove. And if x=-50 then self.pageNo = self.pageNo - 1 and if x=50 then self.pageNo = self.pageNo + 1
  • Ok, then try this one:
    http://www.giderosmobile.com/forum/discussion/693/can-gideros-recognize-gestures

    Set allowRotation and inverseShape to false and add two gestures with (0,0)(0,50) points and vice versa (50,0)(0,0) . And add callback to each gesture to go to next or previous scene
  • @banakil - ar2rsawseen's code is great for tracking gestures, but if you are just trying to understand event tracking, here's something to read:

    http://www.giderosmobile.com/documentation/events.html

    and here's a simple bit of code. (I don't think this would make it into any final code because it is so simple, but hopefully it illustrates a concept)
    local isMouseDown = false
    local originalMousePosition = {x=0, y=0} --I only use x, not y
     
    function onMouseDown(event)
    --only do page turn at edges of page
    --assuming a page width of 320 here
    if event.x < 100 or event.x > 220 then
    isMouseDown = true
    originalMousePosition.x = event.x
    end
    end
     
    function onMouseMove(event)
    --only track back swipe on the left of the screen
    --and a forward swipe on the right of the screen
    if isMouseDown then
    if originalMousePosition.x < 100 and event.x < (originalMousePosition.x - 50) then
    print("Should go back a page here")
    isMouseDown = false
    end
    if originalMousePosition.x > 220 and event.x > (originalMousePosition.x + 50) then
    print("Should go forward a page here")
    isMouseDown = false
    end
    end
     
    --note if you want not to record a gesture that goes in the wrong direction in the middle
    --then you need to track currentMousePosition.x and if it goes the
    --wrong way, then set isMouseDown = false to stop the onMouseMove page turn
    end
     
    function onMouseUp(event)
    isMouseDown = false
    end
     
    stage:addEventListener(Event.MOUSE_DOWN, onMouseDown)
    stage:addEventListener(Event.MOUSE_MOVE, onMouseMove)
    stage:addEventListener(Event.MOUSE_UP, onMouseUp)





  • thanks.
    If there are somebody as much stupid as i am, i can bring my solution(because i just can't understand how "callback" works).
    You can inverse how button works. So make your buttons tall(to fit screen) and make them totally transparent. Then change what buttons do. Originally onMouseUp turn pages if self.focus=true, but you should make call Event.new("click") on self.focus=false.

    I know that it's not brilliant, but it is very easy and may be it can help somebody. And it works.
  • Thanks Caroline, I did't see your message, when start to write.
  • how to add physics like elastic joint to the page?
  • sorry wrong post
  • you could remove the fixed width on assumed size by using event.x> getWidth()*.9
    Then any size will be ok.
    REAL programmers type copy con filename.exe
    ---------------------------------------
  • Hello,
    When I try to download the template, my computer only sees an icon. It does not find the file. Any suggestions?
    Thank you.
  • Thank You!
  • one question about this template. I'm using it and I can't for the life of me understand how to remove the buttons from page0.lua ?

    i've played around and removed the code but not sure where in the scene controller where to make the change.
  • @mysps the buttons added to the screen on scenecontroller.lua . If you want to remove them you need to change the logic of the code a little bit. You need to handle onenterscene of page0 and remove the required button there. And onexit of the scene you need to add it again to the stage.

    If i will go home early today i will try to write it for you how it will be coded :D
  • @talis. ok great i'll start looking there in the scenecontroller! thanks
  • I can't figure it out. i'll use the ndoss scenemanager. it seems to be easier for me to remove the controls.

Howdy, Stranger!

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

Login with Facebook Sign In with Google Sign In with OpenID

In this Discussion

Top Posters