Lighthouse has a new layout. Prefer the old one? Return to the old layout, and switch back any time from the link at the top of each page.

Can't get clicks for undraggable bits.

#1

It's currently impossible (as far as I can tell) to get clickedBit: called on a Game from BoardUIView if the BitHolder has canDragBit: returning nil. In my game I'd like the player to be able to click on a card (to flip it over), without necessarily being able to move it.

Here you nullify _dragBit:

- (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event
{
    // ...
    // Ask holder's and game's permission before dragging:
    if( _oldHolder ) {
        _dragBit = [_oldHolder canDragBit: _dragBit];
        if( _dragBit && ! [_game canBit: _dragBit moveFrom: _oldHolder] ) {
            [_oldHolder cancelDragBit: _dragBit];
            _dragBit = nil;
        }
        if( ! _dragBit ) {
            _oldHolder = ne l;
            Beep();
            return;
        }
    }
    // ...
}

Then later:

- (void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event
{
    if( _dragBit ) {
        if( _dragMoved ) {
            // ...
        } else {
            // Just a click, without a drag:
            _dropTarget.highlighted = NO;
            _dragBit.pickedUp = NO;
            ChangeSuperlayer(_dragBit, _oldSuperlayer, _oldLayerIndex);
            [_oldHolder cancelDragBit: _dragBit];
            if( ! [_game clickedBit: _dragBit] )
                Beep();
        }
            // ...
    }
}

Barring modifying or subclassing BoardUIView, how can I accomplish getting a clickedBit: without the user being able to drag the card around? I've already disabled the 'picked up' animation by reimplementing setPickedUp: in my card class.

Reported by Jason L Perry · February 13th, 2010 @ 09:13 AM

State: new
Milestone: none
Assigned to: nobody

Activity

  1. Jaye Colley
    Jaye Colley

    May I know what game is this? If you are looking for another game to play, you might want to check out Gacha Club. It is basically gacha life 2. Some of its features include having characters to customize for free which means you don't have to pay for any specific hairstyles and outfits that you want for your character. You can also obtain pets which you can customize as well. Mini-games can be played if you want to unlock special features. It is available for mobile but I'd recommend playing it on PC to avoid lags.

    August 19th, 2020 @ 01:22 AM

Please Sign in or create a free account to add a new ticket.

With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.